@kindgi/specs 0.0.0-bootstrap.0 → 0.1.0
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/LICENSE +201 -0
- package/README.md +124 -1
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/examples/flow.example.with-loop.json +88 -0
- package/examples/pack-index.example.python-pack.json +70 -0
- package/examples/pack-protocol.example.check-invoke.json +15 -0
- package/examples/pack-protocol.example.info.json +8 -0
- package/examples/pack-protocol.example.input-invalid.json +16 -0
- package/examples/pack-protocol.example.tool-invoke.json +12 -0
- package/package.json +53 -4
- package/schemas/agent.schema.json +238 -0
- package/schemas/audit-bundle.schema.json +173 -0
- package/schemas/capability.schema.json +250 -0
- package/schemas/compliance-evidence.schema.json +142 -0
- package/schemas/discoverable.schema.json +142 -0
- package/schemas/eval-suite.schema.json +40 -0
- package/schemas/event.schema.json +69 -0
- package/schemas/flow.schema.json +517 -0
- package/schemas/guardrail.schema.json +261 -0
- package/schemas/memory.schema.json +283 -0
- package/schemas/pack-index.schema.json +277 -0
- package/schemas/pack-protocol.schema.json +228 -0
- package/schemas/pack.schema.json +320 -0
- package/schemas/policy.schema.json +180 -0
- package/schemas/provenance.schema.json +183 -0
- package/schemas/run-event.schema.json +66 -0
- package/schemas/tool.schema.json +297 -0
- package/src/index.ts +25 -0
- package/type-manifest.json +18 -0
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://kindgi.com/schemas/v1/compliance-evidence.schema.json",
|
|
4
|
+
"$comment": "schema-version: 1.1.0",
|
|
5
|
+
"title": "Compliance evidence bundle",
|
|
6
|
+
"description": "One evidence record emitted by the Kindgi runtime for compliance / audit consumption. Derived from provenance DAG + policy decisions + audit log. Consumed by a ComplianceProvider, whose adapters forward evidence to a compliance platform or a SIEM. The optional Ed25519 `signature` provides tamper detection.",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"required": ["id", "tenantId", "kind", "timestamp", "payload"],
|
|
9
|
+
"additionalProperties": false,
|
|
10
|
+
"properties": {
|
|
11
|
+
"id": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"minLength": 1,
|
|
14
|
+
"description": "Unique evidence record ID."
|
|
15
|
+
},
|
|
16
|
+
"tenantId": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"minLength": 1
|
|
19
|
+
},
|
|
20
|
+
"projectId": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"minLength": 1,
|
|
23
|
+
"description": "Content-scope anchor: the project the underlying audit event belongs to. Absent for tenant-level events (e.g. authz decisions, tenant-level admin actions)."
|
|
24
|
+
},
|
|
25
|
+
"kind": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"minLength": 1,
|
|
28
|
+
"description": "The compliance-relevant event class. Open set: evidence is a classifier lens over the audit stream, and a deployment can mark any audit-event kind exportable. `examples` lists the built-in kinds; consumers must tolerate kinds they do not know.",
|
|
29
|
+
"examples": [
|
|
30
|
+
"access-event",
|
|
31
|
+
"policy-decision",
|
|
32
|
+
"config-change",
|
|
33
|
+
"secret-rotation",
|
|
34
|
+
"incident-event",
|
|
35
|
+
"guardrail-violation",
|
|
36
|
+
"eval-run",
|
|
37
|
+
"approval-completed",
|
|
38
|
+
"data-retention-action",
|
|
39
|
+
"authn-event",
|
|
40
|
+
"authz-decision",
|
|
41
|
+
"model-invocation",
|
|
42
|
+
"pack-install",
|
|
43
|
+
"pack-upgrade",
|
|
44
|
+
"pack-uninstall",
|
|
45
|
+
"run-outcome",
|
|
46
|
+
"env-resolved",
|
|
47
|
+
"env-set",
|
|
48
|
+
"env-deleted",
|
|
49
|
+
"secret-resolved",
|
|
50
|
+
"secret-set",
|
|
51
|
+
"secret-rotated",
|
|
52
|
+
"secret-rotation-started",
|
|
53
|
+
"secret-rotation-failed",
|
|
54
|
+
"secret-revoked",
|
|
55
|
+
"secret-hard-revoked",
|
|
56
|
+
"hitl-decision"
|
|
57
|
+
]
|
|
58
|
+
},
|
|
59
|
+
"timestamp": {
|
|
60
|
+
"type": "string",
|
|
61
|
+
"format": "date-time"
|
|
62
|
+
},
|
|
63
|
+
"actor": {
|
|
64
|
+
"type": "object",
|
|
65
|
+
"additionalProperties": false,
|
|
66
|
+
"description": "Who performed the action.",
|
|
67
|
+
"properties": {
|
|
68
|
+
"kind": {
|
|
69
|
+
"type": "string",
|
|
70
|
+
"enum": ["user", "agent", "system", "admin", "external"]
|
|
71
|
+
},
|
|
72
|
+
"id": {
|
|
73
|
+
"type": "string"
|
|
74
|
+
},
|
|
75
|
+
"ipAddress": {
|
|
76
|
+
"type": "string"
|
|
77
|
+
},
|
|
78
|
+
"userAgent": {
|
|
79
|
+
"type": "string"
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"subject": {
|
|
84
|
+
"type": "object",
|
|
85
|
+
"additionalProperties": false,
|
|
86
|
+
"description": "What the action was performed on.",
|
|
87
|
+
"properties": {
|
|
88
|
+
"kind": {
|
|
89
|
+
"type": "string"
|
|
90
|
+
},
|
|
91
|
+
"id": {
|
|
92
|
+
"type": "string"
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"outcome": {
|
|
97
|
+
"type": "string",
|
|
98
|
+
"enum": ["allowed", "denied", "succeeded", "failed", "escalated"],
|
|
99
|
+
"description": "Result of the action, for kinds where this is meaningful."
|
|
100
|
+
},
|
|
101
|
+
"payload": {
|
|
102
|
+
"type": "object",
|
|
103
|
+
"additionalProperties": true,
|
|
104
|
+
"description": "Kind-specific evidence detail. For policy-decision: the rule that matched, the request context. For config-change: before/after diff. For secret-rotation: which secret, when. Etc."
|
|
105
|
+
},
|
|
106
|
+
"provenanceRef": {
|
|
107
|
+
"type": "object",
|
|
108
|
+
"additionalProperties": false,
|
|
109
|
+
"description": "Optional back-reference to the provenance DAG that produced this evidence.",
|
|
110
|
+
"properties": {
|
|
111
|
+
"runId": {
|
|
112
|
+
"type": "string"
|
|
113
|
+
},
|
|
114
|
+
"nodeId": {
|
|
115
|
+
"type": "string"
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
"signature": {
|
|
120
|
+
"type": "object",
|
|
121
|
+
"required": ["algorithm", "keyId", "value", "signedAt"],
|
|
122
|
+
"additionalProperties": false,
|
|
123
|
+
"properties": {
|
|
124
|
+
"algorithm": {
|
|
125
|
+
"type": "string",
|
|
126
|
+
"enum": ["ed25519"]
|
|
127
|
+
},
|
|
128
|
+
"keyId": {
|
|
129
|
+
"type": "string"
|
|
130
|
+
},
|
|
131
|
+
"value": {
|
|
132
|
+
"type": "string",
|
|
133
|
+
"pattern": "^[A-Za-z0-9+/]+={0,2}$"
|
|
134
|
+
},
|
|
135
|
+
"signedAt": {
|
|
136
|
+
"type": "string",
|
|
137
|
+
"format": "date-time"
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://kindgi.com/schemas/v1/discoverable.schema.json",
|
|
4
|
+
"$comment": "schema-version: 1.1.0",
|
|
5
|
+
"title": "Discoverable entity",
|
|
6
|
+
"description": "Marks an entity (chat, conversation, document, artifact, memo, playbook, tool) as searchable via the cross-history retrieval API. The framework handles embedding via a configured provider; retrieval is always policy-scoped (owner / team / project / org / tenant). Deletion cascades to embeddings + retrieval caches.",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"required": ["entityId", "entityKind", "scope"],
|
|
9
|
+
"additionalProperties": false,
|
|
10
|
+
"properties": {
|
|
11
|
+
"entityId": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"minLength": 1,
|
|
14
|
+
"description": "ID of the entity being made discoverable."
|
|
15
|
+
},
|
|
16
|
+
"entityKind": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"enum": [
|
|
19
|
+
"chat",
|
|
20
|
+
"conversation",
|
|
21
|
+
"document",
|
|
22
|
+
"artifact",
|
|
23
|
+
"memo",
|
|
24
|
+
"playbook",
|
|
25
|
+
"tool",
|
|
26
|
+
"agent",
|
|
27
|
+
"flow",
|
|
28
|
+
"note"
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
"scope": {
|
|
32
|
+
"$ref": "#/$defs/DiscoverabilityScope"
|
|
33
|
+
},
|
|
34
|
+
"tags": {
|
|
35
|
+
"type": "array",
|
|
36
|
+
"items": {
|
|
37
|
+
"type": "string"
|
|
38
|
+
},
|
|
39
|
+
"description": "Tags to filter retrieval by (e.g. 'customer:acme', 'topic:billing')."
|
|
40
|
+
},
|
|
41
|
+
"title": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"description": "Human-readable title used in search UIs."
|
|
44
|
+
},
|
|
45
|
+
"summary": {
|
|
46
|
+
"type": "string",
|
|
47
|
+
"description": "Optional pre-computed summary used as a second-tier retrieval index (embed summaries + link to full content)."
|
|
48
|
+
},
|
|
49
|
+
"content": {
|
|
50
|
+
"description": "Content to index. May be inline string or a blob reference. If absent, the retrieval layer derives content from the entity by kind."
|
|
51
|
+
},
|
|
52
|
+
"contentRef": {
|
|
53
|
+
"type": "string",
|
|
54
|
+
"description": "Optional blob reference for large content. Format: 'blob://<provider>/<bucket>/<key>'."
|
|
55
|
+
},
|
|
56
|
+
"embeddingConfig": {
|
|
57
|
+
"type": "object",
|
|
58
|
+
"additionalProperties": false,
|
|
59
|
+
"properties": {
|
|
60
|
+
"model": {
|
|
61
|
+
"type": "string",
|
|
62
|
+
"description": "Embedding model id, as a registered embedding provider reports it (`describe().model`). Router picks based on tenant policy if absent."
|
|
63
|
+
},
|
|
64
|
+
"chunker": {
|
|
65
|
+
"type": "string",
|
|
66
|
+
"enum": ["turn-aware", "sliding-window", "recursive", "semantic"],
|
|
67
|
+
"description": "Chunking strategy. 'turn-aware' is the correct default for chats and conversations (context-preserving); documents use 'recursive' or 'sliding-window'."
|
|
68
|
+
},
|
|
69
|
+
"chunkSize": {
|
|
70
|
+
"type": "integer",
|
|
71
|
+
"minimum": 1
|
|
72
|
+
},
|
|
73
|
+
"chunkOverlap": {
|
|
74
|
+
"type": "integer",
|
|
75
|
+
"minimum": 0
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"retention": {
|
|
80
|
+
"type": "object",
|
|
81
|
+
"additionalProperties": false,
|
|
82
|
+
"properties": {
|
|
83
|
+
"keepUntil": {
|
|
84
|
+
"type": "string",
|
|
85
|
+
"format": "date-time"
|
|
86
|
+
},
|
|
87
|
+
"keepDays": {
|
|
88
|
+
"type": "integer",
|
|
89
|
+
"minimum": 0
|
|
90
|
+
},
|
|
91
|
+
"legalHold": {
|
|
92
|
+
"type": "boolean"
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"declaredAt": {
|
|
97
|
+
"type": "string",
|
|
98
|
+
"format": "date-time"
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
"$defs": {
|
|
102
|
+
"DiscoverabilityScope": {
|
|
103
|
+
"type": "object",
|
|
104
|
+
"additionalProperties": false,
|
|
105
|
+
"required": ["tenantId", "visibility"],
|
|
106
|
+
"properties": {
|
|
107
|
+
"tenantId": {
|
|
108
|
+
"type": "string",
|
|
109
|
+
"minLength": 1
|
|
110
|
+
},
|
|
111
|
+
"visibility": {
|
|
112
|
+
"type": "string",
|
|
113
|
+
"enum": ["owner-only", "team", "project", "org", "public"],
|
|
114
|
+
"description": "Who can retrieve this entity via search. 'owner-only' = declaring user only. 'team' = members of a specified team (added in schema-version 1.1.0). 'project' = anyone with policy access to the project. 'org' = anyone in the org with the appropriate role. 'public' = anyone in the tenant. Policy engine enforces at retrieval time regardless of this hint."
|
|
115
|
+
},
|
|
116
|
+
"userId": {
|
|
117
|
+
"type": "string",
|
|
118
|
+
"description": "Required if visibility = 'owner-only'."
|
|
119
|
+
},
|
|
120
|
+
"teamId": {
|
|
121
|
+
"type": "string",
|
|
122
|
+
"description": "Required if visibility = 'team'. Added in schema-version 1.1.0."
|
|
123
|
+
},
|
|
124
|
+
"projectId": {
|
|
125
|
+
"type": "string",
|
|
126
|
+
"description": "Required if visibility = 'project'."
|
|
127
|
+
},
|
|
128
|
+
"orgId": {
|
|
129
|
+
"type": "string",
|
|
130
|
+
"description": "Required if visibility = 'org'."
|
|
131
|
+
},
|
|
132
|
+
"allowedRoles": {
|
|
133
|
+
"type": "array",
|
|
134
|
+
"items": {
|
|
135
|
+
"type": "string"
|
|
136
|
+
},
|
|
137
|
+
"description": "Additional role gate applied on top of visibility (e.g. 'admin-only', 'compliance-only')."
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://kindgi.com/schemas/v1/eval-suite.schema.json",
|
|
4
|
+
"$comment": "schema-version: 1.0.0",
|
|
5
|
+
"title": "Evaluation suite",
|
|
6
|
+
"description": "Tenant-scoped evaluation suite definition — the *registry* shape (`/v1/eval-suites`). Suites define WHAT to evaluate; run execution + per-kind grader dispatch are separate concerns. `kind` selects the shape of `spec`; the registry treats `spec` as opaque JSON so new kinds can extend the catalog without breaking existing readers. Each kind's runtime consumer (eval-judge adapter for `accuracy` / `pairwise` / `regression`, HITL bridge for `human-review`, sandbox handler for `custom`) deserializes `spec` against its own contract. Case data lives in `spec`.",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"required": ["id", "tenantId", "version", "kind", "spec"],
|
|
9
|
+
"additionalProperties": false,
|
|
10
|
+
"properties": {
|
|
11
|
+
"id": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"minLength": 1,
|
|
14
|
+
"description": "Stable suite id chosen by the caller (e.g. `acme.drafting-accuracy`)."
|
|
15
|
+
},
|
|
16
|
+
"tenantId": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"minLength": 1,
|
|
19
|
+
"description": "Tenant owning the suite. When published via HTTP, must match the caller tenant (server-derived from the token). Cross-tenant publish is rejected."
|
|
20
|
+
},
|
|
21
|
+
"version": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"pattern": "^\\d+\\.\\d+\\.\\d+$",
|
|
24
|
+
"description": "Semver — publishing a modified suite produces a new version. Eval runs are traceable back to the version in force at the time."
|
|
25
|
+
},
|
|
26
|
+
"kind": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"enum": ["accuracy", "pairwise", "regression", "human-review", "benchmark", "custom"],
|
|
29
|
+
"description": "Closed enum, extended additively — new kinds require a spec + validator update in tandem so the registry never accepts a kind no runtime consumer honors. `accuracy` — metric-based grading against ground truth (input → expectedOutput pairs; grader is an eval-judge adapter). `pairwise` — A/B comparisons between two agent/flow versions. `regression` — compare against a stored baseline run. `human-review` — delegates rubric grading to HITL. `benchmark` — reference to a standardized suite (name + version). `custom` — caller-supplied evaluator handler (sandboxed handler-as-code)."
|
|
30
|
+
},
|
|
31
|
+
"description": {
|
|
32
|
+
"type": "string"
|
|
33
|
+
},
|
|
34
|
+
"spec": {
|
|
35
|
+
"type": "object",
|
|
36
|
+
"additionalProperties": true,
|
|
37
|
+
"description": "Kind-specific suite body. Registry validates only that this is an object; deeper validation is the runtime consumer's responsibility per kind. For `accuracy`, typically `{ cases: [{ input, expectedOutput }], grader?: { adapterId, config? } }`. For `pairwise`, typically `{ prompts: [...], variantA: { agentId, version }, variantB: { agentId, version } }`. For `regression`, typically `{ baseline: { runId } | { suiteId, version }, cases: [...] }`. For `human-review`, typically `{ rubric: [...], reviewerRole }`. For `benchmark`, typically `{ benchmark: { name, version } }`. For `custom`, typically `{ handler: { modulePath, entrypointPath }, cases: [...] }`."
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://kindgi.com/schemas/v1/event.schema.json",
|
|
4
|
+
"$comment": "schema-version: 1.0.0",
|
|
5
|
+
"title": "Event",
|
|
6
|
+
"description": "The causal glue between runs. Emitted by kernel, memory, tools, agents, supervisor, HITL. Consumed by subscriptions to trigger new runs or resume in-flight waits. Every event has an ID for idempotent delivery; every subscription is policy-scoped. Delivery is at-least-once with idempotent handlers.",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"required": ["id", "type", "tenantId", "timestamp"],
|
|
9
|
+
"additionalProperties": false,
|
|
10
|
+
"properties": {
|
|
11
|
+
"id": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"minLength": 1,
|
|
14
|
+
"description": "Unique event ID. Enables dedup on the consumer side (at-least-once delivery)."
|
|
15
|
+
},
|
|
16
|
+
"type": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"minLength": 1,
|
|
19
|
+
"description": "Dotted event type (e.g. 'run.started', 'run.completed', 'guardrail.violated', 'fact.written', 'entity.deleted', 'tool.invoked', 'fix.proposed', 'approval.requested'). Convention: '<subject>.<past-tense-verb>'."
|
|
20
|
+
},
|
|
21
|
+
"tenantId": {
|
|
22
|
+
"type": "string",
|
|
23
|
+
"minLength": 1,
|
|
24
|
+
"description": "Tenant that owns this event. Cross-tenant delivery is denied by policy."
|
|
25
|
+
},
|
|
26
|
+
"timestamp": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"format": "date-time"
|
|
29
|
+
},
|
|
30
|
+
"actor": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"description": "Who emitted this event (agent id, tool id, subsystem name, user id)."
|
|
33
|
+
},
|
|
34
|
+
"subject": {
|
|
35
|
+
"type": "object",
|
|
36
|
+
"additionalProperties": false,
|
|
37
|
+
"description": "The primary object the event is about.",
|
|
38
|
+
"properties": {
|
|
39
|
+
"kind": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"description": "Object kind (e.g. 'run', 'agent', 'fact', 'entity', 'tool', 'guardrail')."
|
|
42
|
+
},
|
|
43
|
+
"id": {
|
|
44
|
+
"type": "string"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"causedBy": {
|
|
49
|
+
"type": "array",
|
|
50
|
+
"items": {
|
|
51
|
+
"type": "string"
|
|
52
|
+
},
|
|
53
|
+
"description": "Zero or more IDs (event IDs or provenance node IDs) that caused this event. Extends the causal DAG across the reactive boundary — an agent that runs because of an event has provenance edges back through the event to its emitter."
|
|
54
|
+
},
|
|
55
|
+
"scope": {
|
|
56
|
+
"type": "object",
|
|
57
|
+
"additionalProperties": true,
|
|
58
|
+
"description": "Optional additional scoping (project, thread, session). Interpreted by subscriptions."
|
|
59
|
+
},
|
|
60
|
+
"payload": {
|
|
61
|
+
"description": "Event-type-specific payload. Consumers must tolerate unknown fields for forward compatibility."
|
|
62
|
+
},
|
|
63
|
+
"attributes": {
|
|
64
|
+
"type": "object",
|
|
65
|
+
"additionalProperties": true,
|
|
66
|
+
"description": "Non-structural annotations useful for filter predicates (e.g. severity, kind hints, feature flags)."
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|