{"record":{"id":"af9551fa497f67b6","repo":"unicity-aos/aos-ce","slug":"subscribe-key-priority-must-be-an-integer","errorCode":null,"errorMessage":"Subscribe `{key}` priority must be an integer.","messagePattern":"Subscribe `(.+?)` priority must be an integer\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"capsules/capsule-forge/src/checks.rs","lineNumber":247,"sourceCode":"                .get(\"handler\")\n                .and_then(Toml::as_str)\n                .is_some_and(|handler| !handler.is_empty());\n            if entry.get(\"priority\").is_some() && !has_handler {\n                out.push(Finding::err(\n                    format!(\"Subscribe `{key}` sets `priority` without a `handler`.\"),\n                    \"Add a real handler binding or remove priority from the ACL-only subscription.\",\n                ));\n            }\n            if let Some(priority) = entry.get(\"priority\") {\n                if let Some(priority) = priority.as_integer() {\n                    if !(0..=u32::MAX.into()).contains(&priority) {\n                        out.push(Finding::err(\n                            format!(\"Subscribe `{key}` has priority outside the u32 range.\"),\n                            \"Use an integer from 0 through 4294967295; lower values run first.\",\n                        ));\n                    }\n                } else {\n                    out.push(Finding::err(\n                        format!(\"Subscribe `{key}` priority must be an integer.\"),\n                        \"Use an integer from 0 through 4294967295; lower values run first.\",\n                    ));\n                }\n            }\n        }\n\n        let Some(tool) = key.strip_prefix(\"tool.v1.execute.\") else {\n            continue;\n        };\n        // The `*.result` publish key would also strip; skip non-tool shapes.\n        if tool.contains('*') || tool.contains('.') {\n            continue;\n        }\n        saw_execute_tool = true;\n        let has_handler = sub_table\n            .and_then(|t| t.get(key))\n            .and_then(|v| v.get(\"handler\"))","sourceCodeStart":229,"sourceCodeEnd":265,"githubUrl":"https://github.com/unicity-aos/aos-ce/blob/f6f22024fb1e8d122f28a1b4a9f75aee448ae839/capsules/capsule-forge/src/checks.rs#L229-L265","documentation":"capsule-forge validates that a [subscribe] entry's `priority` is an integer (via TOML as_integer). If `priority` is present but is a string, float, or boolean, the type cannot back the u32 dispatcher, so validation emits this error with guidance to use an integer 0..4294967295.","triggerScenarios":"validate_manifest -> check_tool_bus sees a [subscribe] key with a `priority` field whose TOML value is not an integer (e.g. `priority = \"10\"` or `priority = 1.5`).","commonSituations":"Quoting the priority by accident, using a float for readability, or generating the manifest from YAML/JSON where numbers were serialized as strings.","solutions":["Change `priority` in the [subscribe] row to an unquoted integer between 0 and 4294967295.","Remove quotes around numeric values if the manifest was generated from another format.","Re-run `capsule-forge validate` to verify."],"exampleFix":"// before ([subscribe])\n\"tool.v1.request.describe\" = { wit = ..., handler = \"tool_describe\", priority = \"10\" }\n// after\n\"tool.v1.request.describe\" = { wit = ..., handler = \"tool_describe\", priority = 10 }","handlingStrategy":"type-guard","validationCode":"// Validate TOML priority type before validating the manifest\nif let Some(p) = row.get(\"priority\") {\n    assert!(p.is_integer(), \"priority must be an integer\");\n}","typeGuard":"fn priority_is_integer(v: &toml::Value) -> bool { v.is_integer() }","tryCatchPattern":null,"preventionTips":["Never quote numeric fields in the manifest.","Serialize from YAML/JSON generators with numeric types preserved (not strings).","Use a JSON/TOML schema validator in CI to enforce integer types."],"tags":["manifest","config","validation","toml","type-mismatch"],"backgroundTag":"config-type-mismatch","analyzedSha":"f6f22024fb1e8d122f28a1b4a9f75aee448ae839","analyzedAt":"2026-09-13T03:04:44.565Z","contentChangedAt":"2026-09-13T03:04:44.565Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}