<!-- AANCER Developer Reference (English): every field, limit and error code, part 8 of 16. All parts: https://aancer.ai/dev/llms.txt -->

## Common errors

Blueprint import errors appear as `PACK_SCHEMA_INVALID` details with the path `/items/<itemId>/spec/...`.

| Code | Message | Fix |
|---|---|---|
| `AGENT_BLUEPRINT_MODEL` | must be a model tier, written as { "tier": "<name>" }. A blueprint never names a model route | Use `{"tier": "local-advanced"}` |
| `AGENT_BLUEPRINT_TOOL_KIND` | a blueprint cannot carry a tool of kind "code" | Remove `code` and `mcp` tools |
| `AGENT_BLUEPRINT_TOOL_DUPLICATE` | this tool is listed twice | Remove the duplicate |
| `AGENT_BLUEPRINT_REF` | must be a pack parameter, written as {{param.<id>}} | Knowledge tools always use a parameter |
| `AGENT_BLUEPRINT_REF` | names the template "...", which is not an item of this pack | Add the template item, or use a parameter |
| `AGENT_BLUEPRINT_WEB_UNDECLARED` | web search needs a declared data flow with the destination "web-search" | Add the data flow to `declarations` |
| (shape) | must NOT have additional properties / must NOT have more than 12 items | Fix shape errors first; the other checks run after them |
| `AGENT_BLUEPRINT_NOT_AVAILABLE` | This blueprint is no longer available: its pack was retired or withdrawn. | Activate the pack again |
| `AGENT_BLUEPRINT_INVALID` (422) | blueprintId must name a blueprint of an installed pack. | Use `pack:<packId>:<itemId>` of an active pack |
| `AGENT_EXPORT_REFUSED` (422, 403, 503) | The agent cannot be exported: ... | Fix what `reason` names; 403 means you need edit access to the agent |
| `COMPLIANCE_RULE_FAILED` (422) | Compliance rule failed: ... | Change the configuration so the installation's compliance rule passes |
| `AGENT_DRAFT_INVALID` | Duplicate skill. / ... must be a whole number. / Draft exceeds 200000 bytes | Fix the configuration |
| `AGENT_DRAFT_INVALID` | Instructions are required. / Choose exactly one of a model tier or a route. | Fix the configuration |
| `AGENT_DRAFT_INVALID` | A wildcard is only allowed for all connectors, knowledge, workflows or MCP tools. | Name the tool |
| `AGENT_DRAFT_INVALID` | This agent makes automated decisions or requires human oversight, so writes must be confirmed by a person. Set write confirmation to always. | `"confirmWrites": "always"` |
| `AGENT_DRAFT_INVALID` | Decisive automated decisions require human oversight. | `"humanOversightRequired": true` |
| `AGENT_TOOL_UNAVAILABLE` | This tool is not available to you in this workspace. | Enable the connector or knowledge set in that workspace |
| `AGENT_VERSION_CONFLICT` | (409) | Reload and retry with the new `ifUpdatedAt` |
| `CLOUD_TIER_NOT_ALLOWED` | | The workspace policy refuses `cloud-reasoning`; use a local tier |

## Limits and editions

- Up to 64 tools and 12 starters per blueprint. Up to 50,000 characters of instructions.
- Certified agents need the Certified Agents licence feature. Without it, agents still publish with a passport, but they cannot use webhook, schedule or event workflows as tools.
- The `cloud-reasoning` tier can be switched off by workspace policy.
- Check your edition on [aancer.ai/pricing](https://aancer.ai/pricing).



## Dashboards

An AANCER dashboard is data, not code. It is built from four object kinds that stack:

1. a **dataset**: a typed table stored in the installation;
2. a **model**: the semantic layer with entities, dimensions, measures, named filters, variables and joins;
3. a **widget**: a table, a chart, a KPI, Markdown text or a form, bound to a model query;
4. a **dashboard**: a 12-column grid of widgets plus global filters.

Charts are declarative chart specifications (JSON) without data: the platform runs the query and injects the result. Dashboards are versioned. You save a draft, then publish version N, with rollback and retire. You can build them in the UI under **Work > Dashboards**, through the REST API, or ship them in a signed pack with items of kind `dataset`, `model`, `widget` and `dashboard`. Every published dashboard also gets a 2D and 3D view switch, which needs no authoring.

## Quick start

One dataset, one model, one chart, one dashboard, as pack item specs.

```json
{ "id": "sales_orders", "title": "Sales orders",
  "columns": [
    { "id": "date", "type": "date", "required": true },
    { "id": "region", "type": "string", "required": true },
    { "id": "amount", "type": "number", "min": 0 }
  ],
  "retention": { "maxAgeDays": 730 } }
```

```json
{ "id": "sales",
  "entities": { "orders": { "dataset": "sales_orders" } },
  "dimensions": { "region": { "entity": "orders", "column": "region", "label": "Region" } },
  "measures": { "revenue": { "entity": "orders", "agg": "sum", "column": "amount", "label": "Revenue", "format": "currency" } } }
```

```json
{ "id": "revenue_by_region", "type": "chart", "title": "Revenue by region",
  "source": { "model": "sales", "query": { "measures": ["revenue"], "dimensions": ["region"] } },
  "chart": { "mark": "bar", "encoding": {
    "x": { "field": "region", "type": "nominal" },
    "y": { "field": "revenue", "type": "quantitative" } } } }
```

```json
{ "id": "sales-overview", "title": "Sales overview", "icon": "BarChart3",
  "layout": [ { "widget": "revenue_by_region", "x": 0, "y": 0, "w": 12, "h": 8 } ] }
```

## File layout

```text
acme-sales-dashboard/
  manifest.json                         # items: dataset, model, widget(s), dashboard
  content/
    dataset.sales_orders.json
    model.sales.json
    widget.revenue_by_region.json
    dashboard.sales-overview.json
```

Each item uses `"schemaVersion": 1` and `"scope": "workspace"` with `"workspace": "{{param.target_workspace}}"`. Declare `target_workspace` as a `workspace` pack parameter.

## Field reference

JSON Schema: [dashboard.schema.json](https://aancer.ai/dev/schemas/dashboard.schema.json). It has one definition per kind: `dataset`, `model`, `widget`, `dashboard`. Ids match `^[a-z0-9][a-z0-9._-]{0,63}$`; dataset column ids match `^[a-z][a-z0-9_]{0,63}$`.

### Dataset

| Field | Type | Required | Rules |
|---|---|---|---|
| `id` | string | yes | id pattern |
| `title` | string | no | at most 120 characters |
| `columns` | array | yes | 1 to 200 of `{ id, type, label?, required?, min?, max?, maxLength? }`. Column `id` matches `^[a-z][a-z0-9_]{0,63}$`, unique. `type`: `string`, `number`, `integer`, `boolean`, `date`, `datetime`, `json` |
| `key` | string[] | no | up to 8 columns used for upserts |
| `retention` | object | yes | at least one of `maxAgeDays` (1 to 3650) and `maxRows` (1 to 5,000,000) |
| `personalData` | object | no | `{ classes: string[], subjectColumn?: string or null }`. With classes, `subjectColumn` names a declared column and `seedRows` are not used |
| `source` | string | no | `workflow`, `agent`, `chat`, `import`, `pack`, `manual` |
| `seedRows` | object[] | no | up to 5000 initial rows |

Workflows fill datasets with a Publish step, agents with the dataset tool, and embedded apps through the bridge.

### Model

| Field | Type | Required | Rules |
|---|---|---|---|
| `id` | string | yes | id pattern |
| `title` | string | no | at most 120 characters |
| `entities` | object | yes | 1 to 3. Each has exactly one of `dataset` (a dataset id) or `connection` (a connection id or `{{param.x}}`). A connection entity needs `query`: one saved SQL statement (no `;`, `--` or `/*`) of at most 4000 characters with `:param` binds, and `params {name: {type: string, number or date, default?}}` |
| `dimensions` | object | yes | up to 100 of `{ entity, column, label?, granularity? }`. `granularity`: list of `day`, `week`, `month`, `quarter`, `year` |
| `measures` | object | yes | 1 to 100 of `{ entity, agg, column?, label?, format? }`. `agg`: `count`, `sum`, `avg`, `min`, `max`, `distinct`. `format`: `number`, `integer`, `percent`, `currency` |
| `filters` | object | no | up to 100 of `{ dimension, op, value?, param?, label? }`. `op`: `eq`, `neq`, `in`, `gt`, `gte`, `lt`, `lte`, `between`, `in_period`, `contains`. Example: `{"dimension": "date", "op": "in_period", "value": "current_month"}` |
| `variables` | object | no | up to 50 of `{ type, default?, label? }`. `type`: `string`, `number`, `date` |
| `joins` | array | no | up to 3 of `{ id, left: {entity, column}, right: {entity, column}, type }`. `type`: `inner` or `left`. Dataset entities only |

Every dataset also gets an automatic model `m-<datasetId>` with every column as a dimension, `count`, and `sum_<col>` and `avg_<col>` for numeric columns.

### Widget

| Field | Type | Required | Rules |
|---|---|---|---|
| `id` | string | yes | id pattern |
| `type` | string | yes | `table`, `chart`, `kpi`, `markdown`, `form` |
| `title` | string | yes | at most 120 characters |
| `source` | object | for table, chart, kpi | `{ model, query }`. See Model query |
| `table` | object | no | `{ columns?: [{ field, label?, width?, format? }] (up to 50), pageSize?: 1 to 200 }` |
| `chart` | object | for chart | a declarative chart specification (JSON). See Chart rules |
| `kpi` | object | for kpi | `{ measure, compare?: { filter, label? }, format?, label? }` |
| `markdown` | object | for markdown | `{ text }`, at most 20,000 characters, no scripts |
| `form` | object | for form | `{ card, target, onSuccess?: { message? }, personalData?: { classes } }`. See Form widgets |
| `interactions` | object | no | cross-filtering: `{ emit?: { dimension }, listen?: boolean }` |
| `actions` | array | no | up to 5 buttons. See Widget actions |

### Model query

| Field | Rules |
|---|---|
| `measures` | at least 1 measure id of the model |
| `dimensions` | up to 4 dimension ids |
| `filters` | named model filters |
| `variables` | values for model variables |
| `order` | `[{ field, dir: "asc" or "desc" }]` |
| `limit` | 1 to 5000 rows, default 500 |
| `granularity` | `{ "<time dimension>": "day" ... "year" }` |

Up to 8 measures and 3 joins per query.

### Chart rules

- Use `mark` (or `layer`) plus `encoding`. `transform` and `config` are allowed.
- Allowed marks: `bar`, `line`, `area`, `point`, `arc`, `circle`, `square`, `tick`, `rect`, `rule`, `text`, `trail`, `boxplot`, `errorbar`, `errorband`, `geoshape`. No `image`.
- No `data`, no `$schema`, no `url`, and no string with `http://`, `https://`, `//`, `data:` or `url(` anywhere.
- Encode fields by the measure and dimension ids of the query.
- For a good 3D view, use a single mark (`bar`, `line`, `area`, `point`, `arc`) with a nominal or temporal x and a quantitative y.

### Form widgets

`card` is an Adaptive Card, version 1.5 or lower, with a subset of elements:

- Elements: `TextBlock`, `RichTextBlock`, `TextRun`, `Container`, `ColumnSet`, `Column`, `FactSet`, `ActionSet`, `Image` (inline `data:` image under 64 KiB only), `Input.Text`, `Input.Number`, `Input.Date`, `Input.Time`, `Input.Toggle`, `Input.ChoiceSet`.
- Actions: exactly one `Action.Submit` at the top level, plus `Action.ShowCard` and `Action.ToggleVisibility`.
- Up to 40 inputs. Input ids match `^[A-Za-z_][A-Za-z0-9_]{0,63}$`.
- Not allowed: `Action.OpenUrl`, `Action.Execute`, `Media`, `ImageSet`, `Table`, `Carousel`, `selectAction`.

`target` is `{ "kind": "workflow", "flowId": "<id>" }` or `{ "kind": "agent", "agentRef": "<ref>", "prompt": "Handle: {{inputs}}" }`.

### Widget actions

`{ id, label (1 to 60), icon?, handler: { type: "workflow" or "agent", ref }, input?: "{{row}}" or "{{selection}}", confirm?, placement?: "row" or "toolbar" }`. A KPI widget only has toolbar actions.

### Dashboard

| Field | Type | Required | Rules |
|---|---|---|---|
| `id` | string | yes | id pattern |
| `title` | string | yes | 1 to 120 characters |
| `icon` | string | no | `LayoutDashboard`, `BarChart3`, `LineChart`, `PieChart`, `Table2`, `Gauge`, `TrainFront`, `Truck`, `Factory`, `Wallet`, `Receipt`, `Users`, `Briefcase`, `ClipboardList`, `Activity`, `Package`, `ShoppingCart`, `Building2`, `Landmark`, `Leaf` |
| `group` | string | no | at most 60 characters, the heading in the navigation |
| `order` | integer | no | default 100 |
| `filters` | array | no | up to 12 of `{ id, model, filter, control, label?, param?, dimension? }`. `control`: `period`, `select`, `text`, `number`. `filter` must exist on the model |
| `layout` | array | yes | up to 40 of `{ widget, x (0 to 11), y (0 or more), w (1 to 12), h (1 to 40), static? }` |

Layout rules: `x + w` is at most 12, widgets do not overlap, each widget appears once. A grid row is 40 px high.

Next part: https://aancer.ai/dev/parts/reference/09-full-examples.md
