Files
archie/internal/app/controlplane/testdata/dashboard-validators.json
T
sam 12b9a57404 feat(config): model aliases replace model roles, resolved by one resolver
Agent steps, implement, pr-review, MCP sampling, chat, embedding and
transcription resolve a model alias (empty means the purpose's default)
and fail on an unknown alias instead of falling back. The step editor and
chat pick aliases; workflow definitions naming an unknown alias are
refused on save.
2026-10-10 17:29:52 +11:00

229 lines
5.8 KiB
JSON

{
"description": "Shared accept/reject fixtures for the control-plane validators the dashboard hand-mirrors in ui/src/settings/validation.ts. The control plane is the authority: every case's `valid` is what internal/app/controlplane accepts or refuses. The Go test in this package runs the real server validators over these cases; the node test ui/test/control-plane-validator-parity.test.ts runs the real dashboard validators over the same cases. A one-sided change to either rule makes one of the two tests fail, which is the tie that stops the two implementations drifting apart (archie-core-ui-dashboard-3). Add a case here, never only to one side.",
"cases": {
"model-aliases": [
{
"why": "a plain provider/model value",
"value": {
"default": "openai/gpt-4o"
},
"valid": true
},
{
"why": "a trailing space: the server only splits on the slash, so the dashboard must not refuse it",
"value": {
"default": "openai/gpt-4o "
},
"valid": true
},
{
"why": "a model id with a colon (a real ollama tag), which a stricter shape would wrongly refuse",
"value": {
"default": "openai/gpt-4o",
"fast": "ollama/qwen2.5-coder:7b"
},
"valid": true
},
{
"why": "an empty table: nothing configured yet",
"value": {},
"valid": true
},
{
"why": "no slash at all",
"value": {
"default": "gpt-4o"
},
"valid": false
},
{
"why": "an empty model half",
"value": {
"default": "openai/"
},
"valid": false
},
{
"why": "an empty model: the server refuses it, so the dashboard must too (SystemModelsPage deletes the key rather than storing one)",
"value": {
"default": ""
},
"valid": false
},
{
"why": "aliases without the default alias",
"value": {
"fast": "openai/gpt-4o"
},
"valid": false
},
{
"why": "an alias name with capitals or spaces",
"value": {
"default": "openai/gpt-4o",
"Fast model": "openai/gpt-4o"
},
"valid": false
}
],
"scheduling-policy": [
{
"why": "a positive interval, a valid trigger and the label the trigger needs",
"value": {
"poll_interval": "1m0s",
"max_retries": 0,
"label": "archie",
"dispatch": {
"trigger": "assignee"
}
},
"valid": true
},
{
"why": "assignee does not require a label",
"value": {
"poll_interval": "30s",
"max_retries": 3,
"dispatch": {
"trigger": "assignee"
}
},
"valid": true
},
{
"why": "either requires a label, and one is present",
"value": {
"poll_interval": "1h30m",
"label": "archie",
"dispatch": {
"trigger": "either"
}
},
"valid": true
},
{
"why": "a fractional duration the server's parser accepts",
"value": {
"poll_interval": "1.5h",
"dispatch": {
"trigger": "assignee"
}
},
"valid": true
},
{
"why": "a zero interval",
"value": {
"poll_interval": "0s",
"label": "archie",
"dispatch": {
"trigger": "assignee"
}
},
"valid": false
},
{
"why": "an interval the server's parser cannot read",
"value": {
"poll_interval": "nonsense",
"label": "archie",
"dispatch": {
"trigger": "assignee"
}
},
"valid": false
},
{
"why": "the label trigger with no label",
"value": {
"poll_interval": "30s",
"max_retries": 3,
"dispatch": {
"trigger": "label"
}
},
"valid": false
},
{
"why": "the either trigger with an empty label",
"value": {
"poll_interval": "30s",
"max_retries": 0,
"label": "",
"dispatch": {
"trigger": "either"
}
},
"valid": false
}
],
"schedules": [
{
"why": "a single valid workflow job",
"value": [
{
"id": "daily",
"kind": "workflow",
"schedule": {
"kind": "interval",
"interval": "24h0m0s"
}
}
],
"valid": true
},
{
"why": "a cron job with a pool the server recognises",
"value": [
{
"id": "nightly",
"kind": "workflow",
"pool": "parallel",
"schedule": {
"kind": "cron",
"cron": "0 3 * * *"
}
}
],
"valid": true
},
{
"why": "a job with no id",
"value": [
{
"id": "",
"kind": "workflow",
"schedule": {
"kind": "interval",
"interval": "24h0m0s"
}
}
],
"valid": false
},
{
"why": "two jobs sharing an id",
"value": [
{
"id": "daily",
"kind": "workflow",
"schedule": {
"kind": "interval",
"interval": "24h0m0s"
}
},
{
"id": "daily",
"kind": "workflow",
"schedule": {
"kind": "interval",
"interval": "1h0m0s"
}
}
],
"valid": false
}
]
}
}