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
34architecture
35 domain must not depend on infrastructure
36 application may depend on domain
37 infrastructure may implement application ports
38
39implement with ai
40 id: calculate-risk-score
41 scope: function_body
42 strategy: generate_once
43 editing: collaborative
44 risk: medium
45 approval: required
46 may_modify
47 CalculateRiskScore.body
48 must_not_modify
49 CalculateRiskScore.contract
50 Customer
51 RiskScore
52 architecture
53
54selection
55 require all verification checks
56 prefer lower complexity
57 prefer fewer dependencies
58 prefer smaller implementation
59
60verify
61 example low risk customer produces score below 30
62 example high risk customer produces score above 70
63 property score.value between 0 and 100
64 property deterministic for identical input
Draft syntax. This file is illustrative and does not run yet.