From 4aa8446db036bb156c7541e6f1489ec4682253c1 Mon Sep 17 00:00:00 2001 From: Dora Bot Date: Tue, 11 Aug 2026 21:07:00 +0000 Subject: [PATCH] Update JSON schema (f3c032f57cc84869001eb1ff24248632d1df5436) --- dora-schema.json | 2 ++ libraries/core/dora-schema.json | 2 ++ 2 files changed, 4 insertions(+) diff --git a/dora-schema.json b/dora-schema.json index aee3a370e4..313e776fab 100644 --- a/dora-schema.json +++ b/dora-schema.json @@ -253,6 +253,7 @@ ] }, "DataId": { + "description": "A validated data (output) identifier.\n\nA `DataId` may contain only `[a-zA-Z0-9_./-]` and must be non-empty. Unlike\n[`NodeId`], a `DataId` **may** contain `/` (runtime-operator outputs are\nnamespaced as `/`), but leading, trailing, or\nconsecutive slashes — which would produce empty path segments — are\nrejected.\n\n# Parsing vs. conversion (panic footgun)\n\nUse [`str::parse`] / [`FromStr`](std::str::FromStr) for untrusted input: it\nreturns `Result`. The `From` / `From<&str>`\nconversions — and therefore `.into()` and the auto-derived `TryFrom` —\n**panic** on an invalid id.\n\n```\nuse dora_message::id::DataId;\n\nassert!(\"image\".parse::().is_ok());\nassert!(\"op/status\".parse::().is_ok()); // '/' is allowed in a DataId\nassert!(\"a//b\".parse::().is_err()); // empty path segment rejected\nassert!(\"/out\".parse::().is_err()); // leading '/' rejected\nassert!(\"bad id\".parse::().is_err()); // space rejected\n```\n\nThe infallible-looking conversion panics on the same invalid input:\n\n```should_panic\nuse dora_message::id::DataId;\nlet _ = DataId::from(\"a//b\".to_string()); // panics — prefer .parse()\n```", "type": "string" }, "Duration": { @@ -781,6 +782,7 @@ ] }, "NodeId": { + "description": "A validated node identifier.\n\nA `NodeId` may contain only `[a-zA-Z0-9_.-]`, must be non-empty, and must\nnot start with `.` (dot-segments like `.` or `..` could traverse into a\nparent directory when the id is joined into a filesystem path). Unlike\n[`DataId`], a `NodeId` may **not** contain `/`, which separates\n`/` in input-mapping syntax.\n\n# Parsing vs. conversion (panic footgun)\n\nUse [`str::parse`] / [`FromStr`](std::str::FromStr) for untrusted input: it\nreturns `Result`. The `From` conversion — and\ntherefore `.into()` and the auto-derived `TryFrom` — **panics** on\nan invalid id.\n\n```\nuse dora_message::id::NodeId;\n\n// Fallible path — always safe for untrusted input:\nassert!(\"camera_node\".parse::().is_ok());\nassert!(\"node/out\".parse::().is_err()); // '/' is not allowed in a NodeId\nassert!(\"\".parse::().is_err()); // empty is rejected\nassert!(\".hidden\".parse::().is_err()); // leading '.' is rejected\n```\n\nThe infallible-looking conversion panics on the same invalid input:\n\n```should_panic\nuse dora_message::id::NodeId;\nlet _ = NodeId::from(\"node/out\".to_string()); // panics — prefer .parse()\n```", "type": "string" }, "NodeSource": { diff --git a/libraries/core/dora-schema.json b/libraries/core/dora-schema.json index aee3a370e4..313e776fab 100644 --- a/libraries/core/dora-schema.json +++ b/libraries/core/dora-schema.json @@ -253,6 +253,7 @@ ] }, "DataId": { + "description": "A validated data (output) identifier.\n\nA `DataId` may contain only `[a-zA-Z0-9_./-]` and must be non-empty. Unlike\n[`NodeId`], a `DataId` **may** contain `/` (runtime-operator outputs are\nnamespaced as `/`), but leading, trailing, or\nconsecutive slashes — which would produce empty path segments — are\nrejected.\n\n# Parsing vs. conversion (panic footgun)\n\nUse [`str::parse`] / [`FromStr`](std::str::FromStr) for untrusted input: it\nreturns `Result`. The `From` / `From<&str>`\nconversions — and therefore `.into()` and the auto-derived `TryFrom` —\n**panic** on an invalid id.\n\n```\nuse dora_message::id::DataId;\n\nassert!(\"image\".parse::().is_ok());\nassert!(\"op/status\".parse::().is_ok()); // '/' is allowed in a DataId\nassert!(\"a//b\".parse::().is_err()); // empty path segment rejected\nassert!(\"/out\".parse::().is_err()); // leading '/' rejected\nassert!(\"bad id\".parse::().is_err()); // space rejected\n```\n\nThe infallible-looking conversion panics on the same invalid input:\n\n```should_panic\nuse dora_message::id::DataId;\nlet _ = DataId::from(\"a//b\".to_string()); // panics — prefer .parse()\n```", "type": "string" }, "Duration": { @@ -781,6 +782,7 @@ ] }, "NodeId": { + "description": "A validated node identifier.\n\nA `NodeId` may contain only `[a-zA-Z0-9_.-]`, must be non-empty, and must\nnot start with `.` (dot-segments like `.` or `..` could traverse into a\nparent directory when the id is joined into a filesystem path). Unlike\n[`DataId`], a `NodeId` may **not** contain `/`, which separates\n`/` in input-mapping syntax.\n\n# Parsing vs. conversion (panic footgun)\n\nUse [`str::parse`] / [`FromStr`](std::str::FromStr) for untrusted input: it\nreturns `Result`. The `From` conversion — and\ntherefore `.into()` and the auto-derived `TryFrom` — **panics** on\nan invalid id.\n\n```\nuse dora_message::id::NodeId;\n\n// Fallible path — always safe for untrusted input:\nassert!(\"camera_node\".parse::().is_ok());\nassert!(\"node/out\".parse::().is_err()); // '/' is not allowed in a NodeId\nassert!(\"\".parse::().is_err()); // empty is rejected\nassert!(\".hidden\".parse::().is_err()); // leading '.' is rejected\n```\n\nThe infallible-looking conversion panics on the same invalid input:\n\n```should_panic\nuse dora_message::id::NodeId;\nlet _ = NodeId::from(\"node/out\".to_string()); // panics — prefer .parse()\n```", "type": "string" }, "NodeSource": {