@vorionsys/basis 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +22 -0
- package/AMOY-MIGRATION.md +188 -0
- package/DEPLOY-AMOY.md +368 -0
- package/DEPLOY-NOW.md +216 -0
- package/DEPLOYMENT.md +239 -0
- package/GET-WALLET.md +286 -0
- package/QUICK-WALLET-SETUP.md +268 -0
- package/README.md +195 -0
- package/artifacts/@openzeppelin/contracts/access/AccessControl.sol/AccessControl.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/access/AccessControl.sol/AccessControl.json +236 -0
- package/artifacts/@openzeppelin/contracts/access/IAccessControl.sol/IAccessControl.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/access/IAccessControl.sol/IAccessControl.json +204 -0
- package/artifacts/@openzeppelin/contracts/interfaces/IERC4906.sol/IERC4906.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/interfaces/IERC4906.sol/IERC4906.json +328 -0
- package/artifacts/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC1155Errors.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC1155Errors.json +113 -0
- package/artifacts/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC20Errors.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC20Errors.json +97 -0
- package/artifacts/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC721Errors.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC721Errors.json +114 -0
- package/artifacts/@openzeppelin/contracts/token/ERC721/ERC721.sol/ERC721.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/token/ERC721/ERC721.sol/ERC721.json +444 -0
- package/artifacts/@openzeppelin/contracts/token/ERC721/IERC721.sol/IERC721.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/token/ERC721/IERC721.sol/IERC721.json +296 -0
- package/artifacts/@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol/IERC721Receiver.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol/IERC721Receiver.json +45 -0
- package/artifacts/@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol/ERC721Enumerable.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol/ERC721Enumerable.json +521 -0
- package/artifacts/@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol/ERC721URIStorage.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol/ERC721URIStorage.json +476 -0
- package/artifacts/@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol/IERC721Enumerable.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol/IERC721Enumerable.json +352 -0
- package/artifacts/@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol/IERC721Metadata.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol/IERC721Metadata.json +341 -0
- package/artifacts/@openzeppelin/contracts/token/ERC721/utils/ERC721Utils.sol/ERC721Utils.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/token/ERC721/utils/ERC721Utils.sol/ERC721Utils.json +10 -0
- package/artifacts/@openzeppelin/contracts/utils/Context.sol/Context.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/utils/Context.sol/Context.json +10 -0
- package/artifacts/@openzeppelin/contracts/utils/Panic.sol/Panic.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/utils/Panic.sol/Panic.json +10 -0
- package/artifacts/@openzeppelin/contracts/utils/Strings.sol/Strings.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/utils/Strings.sol/Strings.json +37 -0
- package/artifacts/@openzeppelin/contracts/utils/introspection/ERC165.sol/ERC165.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/utils/introspection/ERC165.sol/ERC165.json +30 -0
- package/artifacts/@openzeppelin/contracts/utils/introspection/IERC165.sol/IERC165.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/utils/introspection/IERC165.sol/IERC165.json +30 -0
- package/artifacts/@openzeppelin/contracts/utils/math/Math.sol/Math.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/utils/math/Math.sol/Math.json +10 -0
- package/artifacts/@openzeppelin/contracts/utils/math/SafeCast.sol/SafeCast.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/utils/math/SafeCast.sol/SafeCast.json +65 -0
- package/artifacts/@openzeppelin/contracts/utils/math/SignedMath.sol/SignedMath.dbg.json +4 -0
- package/artifacts/@openzeppelin/contracts/utils/math/SignedMath.sol/SignedMath.json +10 -0
- package/artifacts/build-info/357d1bba4062d461f497f221490811a3.json +1 -0
- package/artifacts/contracts/AgentCard.sol/AgentCard.dbg.json +4 -0
- package/artifacts/contracts/AgentCard.sol/AgentCard.json +1430 -0
- package/build_errors.txt +0 -0
- package/build_output.txt +0 -0
- package/cache/solidity-files-cache.json +885 -0
- package/contracts/AgentCard.sol +478 -0
- package/contracts/deploy/01-deploy-agentcard.ts +66 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/kya/accountability.d.ts.map +1 -0
- package/dist/kya/accountability.js +100 -0
- package/dist/kya/authorization.d.ts.map +1 -0
- package/dist/kya/authorization.js +258 -0
- package/dist/kya/behavior.d.ts.map +1 -0
- package/dist/kya/behavior.js +142 -0
- package/dist/kya/identity.d.ts.map +1 -0
- package/dist/kya/identity.js +187 -0
- package/dist/kya/index.d.ts.map +1 -0
- package/dist/kya/index.js +99 -0
- package/dist/kya/types.d.ts.map +1 -0
- package/dist/kya/types.js +5 -0
- package/dist/trust-1000-agents.test.d.ts.map +1 -0
- package/dist/trust-1000-agents.test.js +608 -0
- package/dist/trust-capabilities.d.ts.map +1 -0
- package/dist/trust-capabilities.js +478 -0
- package/dist/trust-factors.d.ts.map +1 -0
- package/dist/trust-factors.js +588 -0
- package/dist/trust-factors.test.d.ts.map +1 -0
- package/dist/trust-factors.test.js +179 -0
- package/dist/validation-gate.d.ts.map +1 -0
- package/dist/validation-gate.js +468 -0
- package/dist/validation-gate.test.d.ts.map +1 -0
- package/dist/validation-gate.test.js +419 -0
- package/hardhat.config.ts +55 -0
- package/package.json +57 -0
- package/scripts/certify-agent.ts +91 -0
- package/scripts/deploy-agentcard.ts +63 -0
- package/scripts/mint-agentcard.ts +87 -0
- package/specs/adversarial-sandbox-test-suite.md +1055 -0
- package/specs/kya-framework.md +910 -0
- package/specs/trust-factors-v2.md +437 -0
- package/src/index.ts +14 -0
- package/src/kya/accountability.ts +132 -0
- package/src/kya/authorization.ts +325 -0
- package/src/kya/behavior.ts +169 -0
- package/src/kya/identity.ts +224 -0
- package/src/kya/index.ts +125 -0
- package/src/kya/types.ts +242 -0
- package/src/trust-1000-agents.test.ts +745 -0
- package/src/trust-capabilities.ts +517 -0
- package/src/trust-factors.test.ts +241 -0
- package/src/trust-factors.ts +666 -0
- package/src/validation-gate.test.ts +531 -0
- package/src/validation-gate.ts +665 -0
- package/test-kya-simple.ts +258 -0
- package/test-kya.ts +245 -0
- package/tsconfig.json +14 -0
- package/typechain-types/@openzeppelin/contracts/access/AccessControl.ts +324 -0
- package/typechain-types/@openzeppelin/contracts/access/IAccessControl.ts +292 -0
- package/typechain-types/@openzeppelin/contracts/access/index.ts +5 -0
- package/typechain-types/@openzeppelin/contracts/index.ts +11 -0
- package/typechain-types/@openzeppelin/contracts/interfaces/IERC4906.ts +462 -0
- package/typechain-types/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC1155Errors.ts +69 -0
- package/typechain-types/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC20Errors.ts +69 -0
- package/typechain-types/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC721Errors.ts +69 -0
- package/typechain-types/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/index.ts +6 -0
- package/typechain-types/@openzeppelin/contracts/interfaces/index.ts +6 -0
- package/typechain-types/@openzeppelin/contracts/token/ERC721/ERC721.ts +420 -0
- package/typechain-types/@openzeppelin/contracts/token/ERC721/IERC721.ts +393 -0
- package/typechain-types/@openzeppelin/contracts/token/ERC721/IERC721Receiver.ts +110 -0
- package/typechain-types/@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.ts +470 -0
- package/typechain-types/@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.ts +489 -0
- package/typechain-types/@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.ts +443 -0
- package/typechain-types/@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.ts +420 -0
- package/typechain-types/@openzeppelin/contracts/token/ERC721/extensions/index.ts +7 -0
- package/typechain-types/@openzeppelin/contracts/token/ERC721/index.ts +8 -0
- package/typechain-types/@openzeppelin/contracts/token/index.ts +5 -0
- package/typechain-types/@openzeppelin/contracts/utils/Strings.ts +69 -0
- package/typechain-types/@openzeppelin/contracts/utils/index.ts +8 -0
- package/typechain-types/@openzeppelin/contracts/utils/introspection/ERC165.ts +94 -0
- package/typechain-types/@openzeppelin/contracts/utils/introspection/IERC165.ts +94 -0
- package/typechain-types/@openzeppelin/contracts/utils/introspection/index.ts +5 -0
- package/typechain-types/@openzeppelin/contracts/utils/math/SafeCast.ts +69 -0
- package/typechain-types/@openzeppelin/contracts/utils/math/index.ts +4 -0
- package/typechain-types/@openzeppelin/index.ts +5 -0
- package/typechain-types/common.ts +131 -0
- package/typechain-types/contracts/AgentCard.ts +1415 -0
- package/typechain-types/contracts/index.ts +4 -0
- package/typechain-types/factories/@openzeppelin/contracts/access/AccessControl__factory.ts +250 -0
- package/typechain-types/factories/@openzeppelin/contracts/access/IAccessControl__factory.ts +218 -0
- package/typechain-types/factories/@openzeppelin/contracts/access/index.ts +5 -0
- package/typechain-types/factories/@openzeppelin/contracts/index.ts +7 -0
- package/typechain-types/factories/@openzeppelin/contracts/interfaces/IERC4906__factory.ts +339 -0
- package/typechain-types/factories/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC1155Errors__factory.ts +127 -0
- package/typechain-types/factories/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC20Errors__factory.ts +111 -0
- package/typechain-types/factories/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/IERC721Errors__factory.ts +128 -0
- package/typechain-types/factories/@openzeppelin/contracts/interfaces/draft-IERC6093.sol/index.ts +6 -0
- package/typechain-types/factories/@openzeppelin/contracts/interfaces/index.ts +5 -0
- package/typechain-types/factories/@openzeppelin/contracts/token/ERC721/ERC721__factory.ts +455 -0
- package/typechain-types/factories/@openzeppelin/contracts/token/ERC721/IERC721Receiver__factory.ts +59 -0
- package/typechain-types/factories/@openzeppelin/contracts/token/ERC721/IERC721__factory.ts +307 -0
- package/typechain-types/factories/@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable__factory.ts +535 -0
- package/typechain-types/factories/@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage__factory.ts +490 -0
- package/typechain-types/factories/@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable__factory.ts +366 -0
- package/typechain-types/factories/@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata__factory.ts +355 -0
- package/typechain-types/factories/@openzeppelin/contracts/token/ERC721/extensions/index.ts +7 -0
- package/typechain-types/factories/@openzeppelin/contracts/token/ERC721/index.ts +7 -0
- package/typechain-types/factories/@openzeppelin/contracts/token/index.ts +4 -0
- package/typechain-types/factories/@openzeppelin/contracts/utils/Strings__factory.ts +90 -0
- package/typechain-types/factories/@openzeppelin/contracts/utils/index.ts +6 -0
- package/typechain-types/factories/@openzeppelin/contracts/utils/introspection/ERC165__factory.ts +41 -0
- package/typechain-types/factories/@openzeppelin/contracts/utils/introspection/IERC165__factory.ts +41 -0
- package/typechain-types/factories/@openzeppelin/contracts/utils/introspection/index.ts +5 -0
- package/typechain-types/factories/@openzeppelin/contracts/utils/math/SafeCast__factory.ts +118 -0
- package/typechain-types/factories/@openzeppelin/contracts/utils/math/index.ts +4 -0
- package/typechain-types/factories/@openzeppelin/index.ts +4 -0
- package/typechain-types/factories/contracts/AgentCard__factory.ts +1480 -0
- package/typechain-types/factories/contracts/index.ts +4 -0
- package/typechain-types/factories/index.ts +5 -0
- package/typechain-types/index.ts +44 -0
- package/vitest.config.ts +8 -0
package/README.md
ADDED
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
# @vorionsys/basis
|
|
2
|
+
|
|
3
|
+
**Behavioral AI Safety & Integrity Standard (BASIS)** - Open standard for AI agent governance with an 8-tier trust framework, 23 trust factors, and a KYA (Know Your Agent) verification SDK.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
BASIS defines how autonomous AI agents earn, maintain, and lose trust. It provides:
|
|
8
|
+
|
|
9
|
+
- **8 Trust Tiers (T0-T7)**: Progressive autonomy levels from Sandbox to Autonomous
|
|
10
|
+
- **23 Trust Factors**: 15 core + 8 life-critical evaluation criteria
|
|
11
|
+
- **Tier-Gated Capabilities**: What agents can do at each trust level
|
|
12
|
+
- **KYA Framework**: Identity, Authorization, Accountability, and Behavior monitoring
|
|
13
|
+
- **Validation Gate**: Central pass/reject/escalate decisions for agent manifests
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install @vorionsys/basis
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Quick Start
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
import {
|
|
25
|
+
TrustTier,
|
|
26
|
+
CORE_FACTORS,
|
|
27
|
+
calculateTrustScore,
|
|
28
|
+
getRequiredFactors,
|
|
29
|
+
getTrustTierFromScore,
|
|
30
|
+
} from '@vorionsys/basis';
|
|
31
|
+
|
|
32
|
+
// Get required factors for a tier
|
|
33
|
+
const required = getRequiredFactors(TrustTier.T4_OPERATIONAL);
|
|
34
|
+
console.log(`T4 requires ${required.length} factors`);
|
|
35
|
+
|
|
36
|
+
// Calculate trust score from factor scores
|
|
37
|
+
const evaluation = calculateTrustScore(factorScores, TrustTier.T4_OPERATIONAL);
|
|
38
|
+
console.log(`Score: ${evaluation.totalScore}/1000`);
|
|
39
|
+
console.log(`Compliant: ${evaluation.compliant}`);
|
|
40
|
+
console.log(`Missing: ${evaluation.missingFactors}`);
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Trust Tiers
|
|
44
|
+
|
|
45
|
+
| Tier | Score | Name | Factors Required | Description |
|
|
46
|
+
|------|-------|------|-----------------|-------------|
|
|
47
|
+
| T0 | 0-199 | Sandbox | 0 | Observation only, no external access |
|
|
48
|
+
| T1 | 200-349 | Observed | 3 | Basic competence demonstrated |
|
|
49
|
+
| T2 | 350-499 | Provisional | 6 | Accountability + safety emerging |
|
|
50
|
+
| T3 | 500-649 | Verified | 9 | Security + identity confirmed |
|
|
51
|
+
| T4 | 650-799 | Operational | 13 | Human oversight + alignment |
|
|
52
|
+
| T5 | 800-875 | Trusted | 16 | Stewardship + humility |
|
|
53
|
+
| T6 | 876-950 | Certified | 20 | Adaptability + causal reasoning |
|
|
54
|
+
| T7 | 951-1000 | Autonomous | 23 | Full autonomy - all factors |
|
|
55
|
+
|
|
56
|
+
## Trust Factors
|
|
57
|
+
|
|
58
|
+
### Core Factors (15)
|
|
59
|
+
|
|
60
|
+
| Code | Name | Required From | Tier |
|
|
61
|
+
|------|------|--------------|------|
|
|
62
|
+
| CT-COMP | Competence | T1 | Foundational |
|
|
63
|
+
| CT-REL | Reliability | T1 | Foundational |
|
|
64
|
+
| CT-OBS | Observability | T1 | Foundational |
|
|
65
|
+
| CT-TRANS | Transparency | T2 | Foundational |
|
|
66
|
+
| CT-ACCT | Accountability | T2 | Foundational |
|
|
67
|
+
| CT-SAFE | Safety | T2 | Foundational |
|
|
68
|
+
| CT-SEC | Security | T3 | Foundational |
|
|
69
|
+
| CT-PRIV | Privacy | T3 | Foundational |
|
|
70
|
+
| CT-ID | Identity | T3 | Foundational |
|
|
71
|
+
| OP-HUMAN | Human Oversight | T4 | Operational |
|
|
72
|
+
| OP-ALIGN | Alignment | T4 | Operational |
|
|
73
|
+
| OP-STEW | Stewardship | T5 | Operational |
|
|
74
|
+
| SF-HUM | Humility | T5 | Sophisticated |
|
|
75
|
+
| SF-ADAPT | Adaptability | T6 | Sophisticated |
|
|
76
|
+
| SF-LEARN | Continuous Learning | T6 | Sophisticated |
|
|
77
|
+
|
|
78
|
+
### Life-Critical Factors (8)
|
|
79
|
+
|
|
80
|
+
For healthcare, safety, and life-saving AI applications:
|
|
81
|
+
|
|
82
|
+
| Code | Name | Required From |
|
|
83
|
+
|------|------|--------------|
|
|
84
|
+
| LC-UNCERT | Uncertainty Quantification | T4 |
|
|
85
|
+
| LC-HANDOFF | Graceful Degradation & Handoff | T4 |
|
|
86
|
+
| LC-EMPHUM | Empirical Humility | T5 |
|
|
87
|
+
| LC-CAUSAL | Clinical Causal Understanding | T6 |
|
|
88
|
+
| LC-PATIENT | Patient-Centered Autonomy | T6 |
|
|
89
|
+
| LC-EMP | Empathy & Emotional Intelligence | T7 |
|
|
90
|
+
| LC-MORAL | Nuanced Moral Reasoning | T7 |
|
|
91
|
+
| LC-TRACK | Proven Efficacy Track Record | T7 |
|
|
92
|
+
|
|
93
|
+
## KYA (Know Your Agent)
|
|
94
|
+
|
|
95
|
+
The KYA framework provides a complete agent verification pipeline:
|
|
96
|
+
|
|
97
|
+
```typescript
|
|
98
|
+
import { KYA } from '@vorionsys/basis';
|
|
99
|
+
|
|
100
|
+
const kya = new KYA({
|
|
101
|
+
didResolver: myDIDResolver,
|
|
102
|
+
policyEngine: myPolicyEngine,
|
|
103
|
+
database: myDatabase,
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
// Complete verification flow:
|
|
107
|
+
// 1. Identity (DID + signature verification)
|
|
108
|
+
// 2. Authorization (capability + policy check)
|
|
109
|
+
// 3. Accountability (audit chain logging)
|
|
110
|
+
// 4. Behavior (anomaly detection)
|
|
111
|
+
const result = await kya.verifyAgent({
|
|
112
|
+
agentDID: 'did:vorion:agent-123',
|
|
113
|
+
action: 'read',
|
|
114
|
+
resource: 'documents/report.pdf',
|
|
115
|
+
proof: { challenge, signature, timestamp },
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
if (result.allowed) {
|
|
119
|
+
console.log(`Trust score: ${result.trustScore}`);
|
|
120
|
+
console.log(`Anomalies: ${result.anomalies}`);
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Validation Gate
|
|
125
|
+
|
|
126
|
+
Central pass/reject/escalate decisions:
|
|
127
|
+
|
|
128
|
+
```typescript
|
|
129
|
+
import { GateDecision, ValidationSeverity } from '@vorionsys/basis';
|
|
130
|
+
|
|
131
|
+
// GateDecision.PASS - Agent proceeds
|
|
132
|
+
// GateDecision.REJECT - Agent blocked
|
|
133
|
+
// GateDecision.ESCALATE - Human review required
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## Capabilities
|
|
137
|
+
|
|
138
|
+
Tier-gated capabilities define what agents can do:
|
|
139
|
+
|
|
140
|
+
```typescript
|
|
141
|
+
import { getCapabilitiesForTier, hasCapability, TrustTier } from '@vorionsys/basis';
|
|
142
|
+
|
|
143
|
+
const caps = getCapabilitiesForTier(TrustTier.T4_OPERATIONAL);
|
|
144
|
+
const canWrite = hasCapability('CAP-WRITE-DATA', TrustTier.T2_PROVISIONAL);
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Capability categories: Data Access, File Operations, API Access, Code Execution, Agent Interaction, Resource Management, System Administration, Governance.
|
|
148
|
+
|
|
149
|
+
## API Reference
|
|
150
|
+
|
|
151
|
+
### Trust Score Calculation
|
|
152
|
+
|
|
153
|
+
```typescript
|
|
154
|
+
calculateTrustScore(scores: FactorScore[], tier: TrustTier): TrustEvaluation
|
|
155
|
+
getRequiredFactors(tier: TrustTier): FactorCode[]
|
|
156
|
+
getCriticalFactorsForTier(tier: TrustTier): string[]
|
|
157
|
+
getFactorThresholdsForTier(tier: TrustTier): Record<string, FactorThreshold>
|
|
158
|
+
getTrustTierFromScore(score: number): TrustTier
|
|
159
|
+
getTierName(tier: TrustTier): string
|
|
160
|
+
getTierColor(tier: TrustTier): string
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Constants
|
|
164
|
+
|
|
165
|
+
```typescript
|
|
166
|
+
CORE_FACTORS // 15 core trust factors
|
|
167
|
+
LIFE_CRITICAL_FACTORS // 8 life-critical factors
|
|
168
|
+
ALL_FACTORS // All 23 factors combined
|
|
169
|
+
TIER_THRESHOLDS // Score ranges per tier
|
|
170
|
+
TRUST_TIER_DISPLAY // Display config (name, color)
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
## TypeScript
|
|
174
|
+
|
|
175
|
+
```typescript
|
|
176
|
+
import type {
|
|
177
|
+
TrustTier,
|
|
178
|
+
FactorTier,
|
|
179
|
+
FactorCode,
|
|
180
|
+
CoreFactorCode,
|
|
181
|
+
LifeCriticalFactorCode,
|
|
182
|
+
FactorScore,
|
|
183
|
+
TrustEvaluation,
|
|
184
|
+
FactorThreshold,
|
|
185
|
+
Capability,
|
|
186
|
+
CapabilityCategory,
|
|
187
|
+
GateDecision,
|
|
188
|
+
ValidationSeverity,
|
|
189
|
+
KYAConfig,
|
|
190
|
+
} from '@vorionsys/basis';
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
## License
|
|
194
|
+
|
|
195
|
+
Apache-2.0
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_format": "hh-sol-artifact-1",
|
|
3
|
+
"contractName": "AccessControl",
|
|
4
|
+
"sourceName": "@openzeppelin/contracts/access/AccessControl.sol",
|
|
5
|
+
"abi": [
|
|
6
|
+
{
|
|
7
|
+
"inputs": [],
|
|
8
|
+
"name": "AccessControlBadConfirmation",
|
|
9
|
+
"type": "error"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"inputs": [
|
|
13
|
+
{
|
|
14
|
+
"internalType": "address",
|
|
15
|
+
"name": "account",
|
|
16
|
+
"type": "address"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"internalType": "bytes32",
|
|
20
|
+
"name": "neededRole",
|
|
21
|
+
"type": "bytes32"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"name": "AccessControlUnauthorizedAccount",
|
|
25
|
+
"type": "error"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"anonymous": false,
|
|
29
|
+
"inputs": [
|
|
30
|
+
{
|
|
31
|
+
"indexed": true,
|
|
32
|
+
"internalType": "bytes32",
|
|
33
|
+
"name": "role",
|
|
34
|
+
"type": "bytes32"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"indexed": true,
|
|
38
|
+
"internalType": "bytes32",
|
|
39
|
+
"name": "previousAdminRole",
|
|
40
|
+
"type": "bytes32"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"indexed": true,
|
|
44
|
+
"internalType": "bytes32",
|
|
45
|
+
"name": "newAdminRole",
|
|
46
|
+
"type": "bytes32"
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"name": "RoleAdminChanged",
|
|
50
|
+
"type": "event"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"anonymous": false,
|
|
54
|
+
"inputs": [
|
|
55
|
+
{
|
|
56
|
+
"indexed": true,
|
|
57
|
+
"internalType": "bytes32",
|
|
58
|
+
"name": "role",
|
|
59
|
+
"type": "bytes32"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"indexed": true,
|
|
63
|
+
"internalType": "address",
|
|
64
|
+
"name": "account",
|
|
65
|
+
"type": "address"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"indexed": true,
|
|
69
|
+
"internalType": "address",
|
|
70
|
+
"name": "sender",
|
|
71
|
+
"type": "address"
|
|
72
|
+
}
|
|
73
|
+
],
|
|
74
|
+
"name": "RoleGranted",
|
|
75
|
+
"type": "event"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"anonymous": false,
|
|
79
|
+
"inputs": [
|
|
80
|
+
{
|
|
81
|
+
"indexed": true,
|
|
82
|
+
"internalType": "bytes32",
|
|
83
|
+
"name": "role",
|
|
84
|
+
"type": "bytes32"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"indexed": true,
|
|
88
|
+
"internalType": "address",
|
|
89
|
+
"name": "account",
|
|
90
|
+
"type": "address"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"indexed": true,
|
|
94
|
+
"internalType": "address",
|
|
95
|
+
"name": "sender",
|
|
96
|
+
"type": "address"
|
|
97
|
+
}
|
|
98
|
+
],
|
|
99
|
+
"name": "RoleRevoked",
|
|
100
|
+
"type": "event"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"inputs": [],
|
|
104
|
+
"name": "DEFAULT_ADMIN_ROLE",
|
|
105
|
+
"outputs": [
|
|
106
|
+
{
|
|
107
|
+
"internalType": "bytes32",
|
|
108
|
+
"name": "",
|
|
109
|
+
"type": "bytes32"
|
|
110
|
+
}
|
|
111
|
+
],
|
|
112
|
+
"stateMutability": "view",
|
|
113
|
+
"type": "function"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
"inputs": [
|
|
117
|
+
{
|
|
118
|
+
"internalType": "bytes32",
|
|
119
|
+
"name": "role",
|
|
120
|
+
"type": "bytes32"
|
|
121
|
+
}
|
|
122
|
+
],
|
|
123
|
+
"name": "getRoleAdmin",
|
|
124
|
+
"outputs": [
|
|
125
|
+
{
|
|
126
|
+
"internalType": "bytes32",
|
|
127
|
+
"name": "",
|
|
128
|
+
"type": "bytes32"
|
|
129
|
+
}
|
|
130
|
+
],
|
|
131
|
+
"stateMutability": "view",
|
|
132
|
+
"type": "function"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"inputs": [
|
|
136
|
+
{
|
|
137
|
+
"internalType": "bytes32",
|
|
138
|
+
"name": "role",
|
|
139
|
+
"type": "bytes32"
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
"internalType": "address",
|
|
143
|
+
"name": "account",
|
|
144
|
+
"type": "address"
|
|
145
|
+
}
|
|
146
|
+
],
|
|
147
|
+
"name": "grantRole",
|
|
148
|
+
"outputs": [],
|
|
149
|
+
"stateMutability": "nonpayable",
|
|
150
|
+
"type": "function"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"inputs": [
|
|
154
|
+
{
|
|
155
|
+
"internalType": "bytes32",
|
|
156
|
+
"name": "role",
|
|
157
|
+
"type": "bytes32"
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"internalType": "address",
|
|
161
|
+
"name": "account",
|
|
162
|
+
"type": "address"
|
|
163
|
+
}
|
|
164
|
+
],
|
|
165
|
+
"name": "hasRole",
|
|
166
|
+
"outputs": [
|
|
167
|
+
{
|
|
168
|
+
"internalType": "bool",
|
|
169
|
+
"name": "",
|
|
170
|
+
"type": "bool"
|
|
171
|
+
}
|
|
172
|
+
],
|
|
173
|
+
"stateMutability": "view",
|
|
174
|
+
"type": "function"
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
"inputs": [
|
|
178
|
+
{
|
|
179
|
+
"internalType": "bytes32",
|
|
180
|
+
"name": "role",
|
|
181
|
+
"type": "bytes32"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
"internalType": "address",
|
|
185
|
+
"name": "callerConfirmation",
|
|
186
|
+
"type": "address"
|
|
187
|
+
}
|
|
188
|
+
],
|
|
189
|
+
"name": "renounceRole",
|
|
190
|
+
"outputs": [],
|
|
191
|
+
"stateMutability": "nonpayable",
|
|
192
|
+
"type": "function"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"inputs": [
|
|
196
|
+
{
|
|
197
|
+
"internalType": "bytes32",
|
|
198
|
+
"name": "role",
|
|
199
|
+
"type": "bytes32"
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
"internalType": "address",
|
|
203
|
+
"name": "account",
|
|
204
|
+
"type": "address"
|
|
205
|
+
}
|
|
206
|
+
],
|
|
207
|
+
"name": "revokeRole",
|
|
208
|
+
"outputs": [],
|
|
209
|
+
"stateMutability": "nonpayable",
|
|
210
|
+
"type": "function"
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
"inputs": [
|
|
214
|
+
{
|
|
215
|
+
"internalType": "bytes4",
|
|
216
|
+
"name": "interfaceId",
|
|
217
|
+
"type": "bytes4"
|
|
218
|
+
}
|
|
219
|
+
],
|
|
220
|
+
"name": "supportsInterface",
|
|
221
|
+
"outputs": [
|
|
222
|
+
{
|
|
223
|
+
"internalType": "bool",
|
|
224
|
+
"name": "",
|
|
225
|
+
"type": "bool"
|
|
226
|
+
}
|
|
227
|
+
],
|
|
228
|
+
"stateMutability": "view",
|
|
229
|
+
"type": "function"
|
|
230
|
+
}
|
|
231
|
+
],
|
|
232
|
+
"bytecode": "0x",
|
|
233
|
+
"deployedBytecode": "0x",
|
|
234
|
+
"linkReferences": {},
|
|
235
|
+
"deployedLinkReferences": {}
|
|
236
|
+
}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_format": "hh-sol-artifact-1",
|
|
3
|
+
"contractName": "IAccessControl",
|
|
4
|
+
"sourceName": "@openzeppelin/contracts/access/IAccessControl.sol",
|
|
5
|
+
"abi": [
|
|
6
|
+
{
|
|
7
|
+
"inputs": [],
|
|
8
|
+
"name": "AccessControlBadConfirmation",
|
|
9
|
+
"type": "error"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"inputs": [
|
|
13
|
+
{
|
|
14
|
+
"internalType": "address",
|
|
15
|
+
"name": "account",
|
|
16
|
+
"type": "address"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"internalType": "bytes32",
|
|
20
|
+
"name": "neededRole",
|
|
21
|
+
"type": "bytes32"
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"name": "AccessControlUnauthorizedAccount",
|
|
25
|
+
"type": "error"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"anonymous": false,
|
|
29
|
+
"inputs": [
|
|
30
|
+
{
|
|
31
|
+
"indexed": true,
|
|
32
|
+
"internalType": "bytes32",
|
|
33
|
+
"name": "role",
|
|
34
|
+
"type": "bytes32"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"indexed": true,
|
|
38
|
+
"internalType": "bytes32",
|
|
39
|
+
"name": "previousAdminRole",
|
|
40
|
+
"type": "bytes32"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"indexed": true,
|
|
44
|
+
"internalType": "bytes32",
|
|
45
|
+
"name": "newAdminRole",
|
|
46
|
+
"type": "bytes32"
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"name": "RoleAdminChanged",
|
|
50
|
+
"type": "event"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"anonymous": false,
|
|
54
|
+
"inputs": [
|
|
55
|
+
{
|
|
56
|
+
"indexed": true,
|
|
57
|
+
"internalType": "bytes32",
|
|
58
|
+
"name": "role",
|
|
59
|
+
"type": "bytes32"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"indexed": true,
|
|
63
|
+
"internalType": "address",
|
|
64
|
+
"name": "account",
|
|
65
|
+
"type": "address"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"indexed": true,
|
|
69
|
+
"internalType": "address",
|
|
70
|
+
"name": "sender",
|
|
71
|
+
"type": "address"
|
|
72
|
+
}
|
|
73
|
+
],
|
|
74
|
+
"name": "RoleGranted",
|
|
75
|
+
"type": "event"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"anonymous": false,
|
|
79
|
+
"inputs": [
|
|
80
|
+
{
|
|
81
|
+
"indexed": true,
|
|
82
|
+
"internalType": "bytes32",
|
|
83
|
+
"name": "role",
|
|
84
|
+
"type": "bytes32"
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"indexed": true,
|
|
88
|
+
"internalType": "address",
|
|
89
|
+
"name": "account",
|
|
90
|
+
"type": "address"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"indexed": true,
|
|
94
|
+
"internalType": "address",
|
|
95
|
+
"name": "sender",
|
|
96
|
+
"type": "address"
|
|
97
|
+
}
|
|
98
|
+
],
|
|
99
|
+
"name": "RoleRevoked",
|
|
100
|
+
"type": "event"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"inputs": [
|
|
104
|
+
{
|
|
105
|
+
"internalType": "bytes32",
|
|
106
|
+
"name": "role",
|
|
107
|
+
"type": "bytes32"
|
|
108
|
+
}
|
|
109
|
+
],
|
|
110
|
+
"name": "getRoleAdmin",
|
|
111
|
+
"outputs": [
|
|
112
|
+
{
|
|
113
|
+
"internalType": "bytes32",
|
|
114
|
+
"name": "",
|
|
115
|
+
"type": "bytes32"
|
|
116
|
+
}
|
|
117
|
+
],
|
|
118
|
+
"stateMutability": "view",
|
|
119
|
+
"type": "function"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"inputs": [
|
|
123
|
+
{
|
|
124
|
+
"internalType": "bytes32",
|
|
125
|
+
"name": "role",
|
|
126
|
+
"type": "bytes32"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"internalType": "address",
|
|
130
|
+
"name": "account",
|
|
131
|
+
"type": "address"
|
|
132
|
+
}
|
|
133
|
+
],
|
|
134
|
+
"name": "grantRole",
|
|
135
|
+
"outputs": [],
|
|
136
|
+
"stateMutability": "nonpayable",
|
|
137
|
+
"type": "function"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"inputs": [
|
|
141
|
+
{
|
|
142
|
+
"internalType": "bytes32",
|
|
143
|
+
"name": "role",
|
|
144
|
+
"type": "bytes32"
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"internalType": "address",
|
|
148
|
+
"name": "account",
|
|
149
|
+
"type": "address"
|
|
150
|
+
}
|
|
151
|
+
],
|
|
152
|
+
"name": "hasRole",
|
|
153
|
+
"outputs": [
|
|
154
|
+
{
|
|
155
|
+
"internalType": "bool",
|
|
156
|
+
"name": "",
|
|
157
|
+
"type": "bool"
|
|
158
|
+
}
|
|
159
|
+
],
|
|
160
|
+
"stateMutability": "view",
|
|
161
|
+
"type": "function"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"inputs": [
|
|
165
|
+
{
|
|
166
|
+
"internalType": "bytes32",
|
|
167
|
+
"name": "role",
|
|
168
|
+
"type": "bytes32"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"internalType": "address",
|
|
172
|
+
"name": "callerConfirmation",
|
|
173
|
+
"type": "address"
|
|
174
|
+
}
|
|
175
|
+
],
|
|
176
|
+
"name": "renounceRole",
|
|
177
|
+
"outputs": [],
|
|
178
|
+
"stateMutability": "nonpayable",
|
|
179
|
+
"type": "function"
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"inputs": [
|
|
183
|
+
{
|
|
184
|
+
"internalType": "bytes32",
|
|
185
|
+
"name": "role",
|
|
186
|
+
"type": "bytes32"
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
"internalType": "address",
|
|
190
|
+
"name": "account",
|
|
191
|
+
"type": "address"
|
|
192
|
+
}
|
|
193
|
+
],
|
|
194
|
+
"name": "revokeRole",
|
|
195
|
+
"outputs": [],
|
|
196
|
+
"stateMutability": "nonpayable",
|
|
197
|
+
"type": "function"
|
|
198
|
+
}
|
|
199
|
+
],
|
|
200
|
+
"bytecode": "0x",
|
|
201
|
+
"deployedBytecode": "0x",
|
|
202
|
+
"linkReferences": {},
|
|
203
|
+
"deployedLinkReferences": {}
|
|
204
|
+
}
|