Skip to main content
IntentLang
← All examples

CalculateRiskScore

examples/CalculateRiskScore.intent

CalculateRiskScore.intent
1# CalculateRiskScore.intent , demonstrates an intentionally deferred AI implementation.
2# The mission declares the CONTRACT and BOUNDARIES; AI writes the body; OpenThunder
3# verifies it; the state is tracked. See docs/ai-implementations.md.
4
5mission CalculateRiskScore
6
7goal
8 Calculate a customer's risk score from their profile and transactions.
9
10why
11 Risk scores drive lending and fraud decisions, so the result must be deterministic
12 and must never leak personal data.
13
14input
15 customer: Customer
16
17output
18 score: RiskScore
19
20requires
21 customer.id is not empty
22 customer.transactions.count > 0
23
24guarantees
25 score.value is at least 0
26 score.value is at most 100
27 same customer produces same score
28
29never
30 expose customer.ssn
31 call external network services
32 use nondeterministic randomness
33
34implement with ai
35 id: calculate-risk-score
36 scope: function_body
37 strategy: generate_once
38 editing: collaborative
39 risk: medium
40 approval: required
41 may_modify
42 CalculateRiskScore.body
43 must_not_modify
44 CalculateRiskScore.contract
45 Customer
46 RiskScore
47 architecture
48
49verify
50 example low risk customer produces score below 30
51 example high risk customer produces score above 70
52 property score.value between 0 and 100
53 property deterministic for identical input
Draft syntax. This file is illustrative and does not run yet.