Level 10 / Project 07 - High Risk Change Gate¶
Home: README
Learn Your Way¶
| Read | Build | Watch | Test | Review | Visualize | Try |
|---|---|---|---|---|---|---|
| Concept | This project | — | Quiz | Flashcards | — | — |
Focus¶
- Weighted risk scoring pipeline with pluggable factors
- Gate policy enforcement (auto-approve, review, block)
- Immutable change request modeling
- Rollback detection as a risk reducer
Why this project exists¶
Production incidents often stem from changes deployed without proportionate review. This system quantifies risk with multiple weighted factors and enforces proportionate gates: small doc fixes auto-approve, while schema migrations to three services get blocked until multiple reviewers sign off.
Run (copy/paste)¶
Expected terminal output¶
{"change_id": "CHG-001", "risk_level": "LOW", "decision": "approved", ...}
{"change_id": "CHG-002", "risk_level": "HIGH", "decision": "needs_review", ...}
Alter it (required)¶
- Add a
TimeOfDayFactorthat scores higher for deployments during peak traffic hours. - Add an override mechanism: certain users (e.g., "oncall-lead") can bypass the gate with an audit trail.
- Re-run tests and verify the new factor integrates into the scoring pipeline.
Break it (required)¶
- Create a change that hits every risk factor — observe how scores accumulate to CRITICAL.
- Register no factors and observe a zero-score auto-approval for a clearly risky change.
- Set
is_rollback=Truewith many other risk factors and see if it still reduces risk.
Fix it (required)¶
- Add a minimum-score floor per factor type so rollback alone cannot bring risk to zero for a critical change.
- Require at least one factor registered before
evaluatecan be called. - Add tests for both safeguards.
Explain it (teach-back)¶
- Why is risk quantified as a numeric score rather than a categorical label?
- How does the
RollbackFactornegative score interact with the floor at zero? - What is the relationship between risk level and the number of required approvers?
- How would you integrate this gate into a CI/CD pipeline?
Mastery check¶
You can move on when you can:
- add a custom risk factor and see it reflected in the gate decision,
- explain the risk level thresholds and why they map to specific policies,
- trace how a rollback reduces total risk score,
- describe why immutable ChangeRequest prevents accidental mutation.
Related Concepts¶
| ← Prev | Home | Next → |
|---|---|---|