AgentTicket agent.ticket@1
Generated at from
openvibe-contracts v0.419.0 and
openvibe-sdk v0.161.0.
- Version
- 1.0.0
- Owner
- actor
- Visibility
- public
- Status
- active
- Compatibility
- backward
- Schema
https://openvibe.network/contracts/agent/ticket.v1.json
Authorized work with an immutable mandate. Policy changes notify, never cancel. Revalidate before resuming an ended ticket; bots and CI cannot resume it. Stage applies to open tickets.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
id | string | yes |
| |
trigger_id | string | yes |
| |
mandate | object | yes |
| |
mandate.policy_version | string | yes |
| |
mandate.scope | string | yes |
| |
mandate.strength | enum | yes |
| |
mandate.matched_rules | array of string | yes |
| |
mandate.actor | object | yes |
| |
mandate.actor.source | string | yes |
| |
mandate.actor.id | string | yes |
| |
mandate.actor.kind | enum | yes |
| |
mandate.source_scope | string | yes |
| |
mandate.budget | object | yes |
| |
mandate.budget.usd | number | yes |
| |
mandate.budget.tokens | integer | yes |
| |
mandate.budget.wall_minutes | number | yes |
| |
state | enum | yes |
| |
stage | agent.stage | yes | ||
threads | array of string | yes |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: example
{
"id": "tkt_1",
"trigger_id": "trg_1",
"mandate": {
"policy_version": "1",
"scope": "Fix issue 1",
"strength": "explicit",
"matched_rules": [],
"actor": {
"source": "github",
"id": "owner",
"kind": "person"
},
"source_scope": "issues",
"budget": {
"usd": 2,
"tokens": 100000,
"wall_minutes": 30
}
},
"state": "open",
"stage": "working",
"threads": [
"issue:1"
]
}Rejected: budget
{
"id": "tkt_1",
"trigger_id": "trg_1",
"mandate": {
"policy_version": "1",
"scope": "Fix issue 1",
"strength": "explicit",
"matched_rules": [],
"actor": {
"source": "github",
"id": "owner",
"kind": "person"
},
"source_scope": "issues",
"budget": {
"usd": -1,
"tokens": 100000,
"wall_minutes": 30
}
},
"state": "open",
"stage": "working",
"threads": [
"issue:1"
]
}Rejected: unknown
{
"id": "tkt_1",
"trigger_id": "trg_1",
"mandate": {
"policy_version": "1",
"scope": "Fix issue 1",
"strength": "explicit",
"matched_rules": [],
"actor": {
"source": "github",
"id": "owner",
"kind": "person"
},
"source_scope": "issues",
"budget": {
"usd": 2,
"tokens": 100000,
"wall_minutes": 30
}
},
"state": "open",
"stage": "working",
"threads": [
"issue:1"
],
"unexpected": true
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('agent.ticket@1', value); // { valid, errors: [{ path, message }] }