Phase gate audit procedures for GeoSupply — connectivity checks, logic gap validation, coverage verification, schema sync, DEVELOPMENT_TRAIL.md update, and security pen-test before closing any development phase.
Zero DeprecationWarning (especially no datetime.utcnow())
Step 4: Security Audit (Pre-Gate)
# PT-01: Scan for hardcoded secrets
PYTHONPATH=src python -c "
import re, pathlib
PATTERNS = [r'sk-[a-zA-Z0-9]{32,}', r'api_key\s*=\s*[\"\\'][^\"\\'][10,}']
for f in pathlib.Path('src').rglob('*.py'):
content = f.read_text()
for p in PATTERNS:
if re.search(p, content):
print(f'❌ CRITICAL: Secret in {f}')
exit(1)
print('✅ No hardcoded secrets found')
"
# PT-05: Verify HALLUCINATION_FLOOR is unchanged
PYTHONPATH=src python -c "
from geosupply.config import HALLUCINATION_FLOOR
assert HALLUCINATION_FLOOR == 0.70, f'CRITICAL: Floor changed to {HALLUCINATION_FLOOR}'
print(f'✅ HALLUCINATION_FLOOR = {HALLUCINATION_FLOOR}')
"
# PT-04: Verify BUDGET_CAP_INR is unchanged
PYTHONPATH=src python -c "
from geosupply.config import BUDGET_CAP_INR
assert BUDGET_CAP_INR == 500.0, f'CRITICAL: Budget cap changed to {BUDGET_CAP_INR}'
print(f'✅ BUDGET_CAP_INR = ₹{BUDGET_CAP_INR}')
"
Step 5: Schema Sync Verification
PYTHONPATH=src python -c "
from geosupply.schemas import ALL_SCHEMAS, SCHEMA_VERSIONS
missing = [s.__name__ for s in ALL_SCHEMAS if s.__name__ not in SCHEMA_VERSIONS]
if missing:
print(f'❌ Schemas missing from SCHEMA_VERSIONS: {missing}')
exit(1)
print(f'✅ All {len(ALL_SCHEMAS)} schemas have version entries')
"
Step 6: DEVELOPMENT_TRAIL.md Sync
Manually verify the following match audit output:
## Sync Checklist
- [ ] Worker count in DEVELOPMENT_TRAIL.md matches `audit --level strict` output
- [ ] Agent count in DEVELOPMENT_TRAIL.md matches `audit --level strict` output
- [ ] All workers claimed as "completed" have test files in tests/unit/
- [ ] All agents claimed as "completed" have test files in tests/unit/
- [ ] Phase description accurately reflects implemented features
- [ ] "Next phase" section updated with correct remaining work
- [ ] Commit hash of phase gate noted in DEVELOPMENT_TRAIL.md
Update DEVELOPMENT_TRAIL.md with actual counts BEFORE committing phase gate.