An Ignition-style tag with quality and timestamp semantics. Used for routing, topics, and runtime state.
name: Tag
version: 1.0.0
fields:
path: { type: string, required: true, description: "Slash-delimited identifier" }
value: { type: any, required: false }
quality: { type: enum, required: false, values: [good, stale, bad], default: good }
ts: { type: int, required: false, description: "Epoch milliseconds" }
from dataclasses import dataclass
from typing import Any, Literal
Quality = Literal["good","stale","bad"]
@dataclass
class Tag:
path: str
value: Any = None
quality: Quality = "good"
ts: int | None = None
CREATE TABLE IF NOT EXISTS tags (
path TEXT PRIMARY KEY,
value TEXT,
quality TEXT NOT NULL DEFAULT 'good'
CHECK(quality IN ('good','stale','bad')),
ts INTEGER
);
export type Quality = "good" | "stale" | "bad";
export interface Tag {
path: string;
value?: unknown;
quality?: Quality;
ts?: number;
}
{
"$schema": "https://json-schema.org/draft-07/schema#",
"$id": "acg.udt.Tag",
"type": "object",
"required": ["path"],
"properties": {
"path": {"type":"string"},
"value": {},
"quality": {"enum":["good","stale","bad"],"default":"good"},
"ts": {"type":"integer"}
}
}
{ "path": "plant/line1/state", "value": "RUNNING", "quality": "good", "ts": 1745000000000 }