github.com/gemaraproj/gemara@v1.3.0

entities.cue raw

 1// SPDX-License-Identifier: Apache-2.0
 2
 3// Schema lifecycle: experimental | stable | deprecated
 4@status("stable")
 5package gemara
 6
 7@go(gemara)
 8
 9// Entity represents a human or tool
10#Entity: {
11	// id uniquely identifies the entity and allows this entry to be referenced by other elements
12	id: string
13
14	// name is the name of the entity
15	name: string
16
17	// type specifies the type of entity interacting in the workflow
18	type: #EntityType
19
20	// version is the version of the entity (for tools; if applicable)
21	version?: string
22
23	// description provides additional context about the entity
24	description?: string
25
26	// uri is a general URI for the entity information
27	uri?: =~"^https?://[^\\s]+$"
28}
29
30// Actor represents an entity (human or tool) that performs actions in evaluations
31#Actor: {
32	#Entity
33
34	// contact is contact information for the actor
35	contact?: #Contact @go(Contact)
36}
37
38// Resource represents an entity that exists in the system and can be evaluated
39#Resource: {
40	#Entity
41
42	// environment describes where the resource exists (e.g., production, staging, development, specific region)
43	environment?: string @go(Environment)
44
45	// owner is the contact information for the person or group responsible for managing or owning this resource
46	owner?: #Contact @go(Owner)
47}
48
49// EntityType specifies what entity is interacting in the workflow
50#EntityType: "Human" | "Software" | "Software Assisted" @go(-)
51
52// Contact is the contact information for a person or group
53#Contact: {
54	// name is the preferred descriptor for the contact entity
55	name: string
56
57	// affiliation is the organization with which the contact entity is associated, such as a team, school, or employer
58	affiliation?: string @go(Affiliation,type=*string)
59
60	// email is the preferred email address to reach the contact
61	email?: #Email @go(Email,type=*Email)
62
63	// social is a social media handle or other profile for the contact, such as GitHub
64	social?: string @go(Social,type=*string)
65}
66
67// Email represents a validated email address pattern
68#Email: =~"^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}$"
69
70// RACI defines the roles responsible for managing an artifact
71#RACI: {
72	// responsible identifies the entities responsible for executing work to manage or mitigate the artifact
73	responsible: [#Contact, ...#Contact]
74
75	// accountable identifies the entity ultimately accountable for the outcome
76	accountable: [#Contact, ...#Contact]
77
78	// consulted identifies entities whose input is required when assessing or responding to the artifact
79	consulted?: [#Contact, ...#Contact]
80
81	// informed identifies entities that should be notified about changes to the artifact status
82	informed?: [#Contact, ...#Contact]
83}