Three git disasters AI shipped — and what got rotated — step 8 of 8
One last thing before we move on. Same surface as a write step — but the lesson doesn't complete until this passes.
Final drill. You're the new security lead on a five-repo engineering org. Walk through the portfolio and triage.
Write triage_repos(repos) that takes a list of repo dicts (same
shape as the previous step) and returns a tuple
(scores, riskiest):
scores: a dict mapping each repo's name → its score (0-100), using the same scoring rules asaudit_repo:- +20 for
has_gitignore_for_envTrue - +20 for
has_secret_scanning_hookTrue - +20 for
reviewer_required_for_mainTrue - +20 for
agent_can_auto_commitFalse (inverted) - +20 for
secrets_in_env_vars_onlyTrue
- +20 for
riskiest: the name of the repo with the LOWEST score (most likely to leak next). On a tie, return the FIRST one — useminwith akey=argument and a stable iteration over the input list.
Five repos run. Expected output:
scores: {'core-api': 100, 'admin-dashboard': 60, 'ml-pipeline': 40, 'legacy-billing': 0, 'docs-site': 80}
most likely to leak next: legacy-billing
One last thing before we move on. Same surface as a write step — but the lesson doesn't complete until this passes.
Final drill. You're the new security lead on a five-repo engineering org. Walk through the portfolio and triage.
Write triage_repos(repos) that takes a list of repo dicts (same
shape as the previous step) and returns a tuple
(scores, riskiest):
scores: a dict mapping each repo's name → its score (0-100), using the same scoring rules asaudit_repo:- +20 for
has_gitignore_for_envTrue - +20 for
has_secret_scanning_hookTrue - +20 for
reviewer_required_for_mainTrue - +20 for
agent_can_auto_commitFalse (inverted) - +20 for
secrets_in_env_vars_onlyTrue
- +20 for
riskiest: the name of the repo with the LOWEST score (most likely to leak next). On a tie, return the FIRST one — useminwith akey=argument and a stable iteration over the input list.
Five repos run. Expected output:
scores: {'core-api': 100, 'admin-dashboard': 60, 'ml-pipeline': 40, 'legacy-billing': 0, 'docs-site': 80}
most likely to leak next: legacy-billing
this step needs the editor
on desktop today; in the app (coming soon). save your spot and we'll bring you back here when you're ready.