{"record":{"id":"747d7928d33b704e","repo":"Hmbown/CodeWhale","slug":"fleet-field-must-be-a-simple-ascii-token-no-long","errorCode":null,"errorMessage":"fleet {field} must be a simple ASCII token no longer than {MAX_FLEET_ID_BYTES} bytes","messagePattern":"fleet (.+?) must be a simple ASCII token no longer than (.+?) bytes","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/fleet/task_spec.rs","lineNumber":212,"sourceCode":"            bail!(\"duplicate fleet worker id {}\", worker.id);\n        }\n        validate_fleet_name(&format!(\"worker {} name\", worker.id), &worker.name)?;\n        if worker.trust_level.is_some() {\n            bail!(\n                \"fleet worker {} trust_level is a legacy compatibility field, not Fleet identity; configure execution authority through Runtime policy\",\n                worker.id\n            );\n        }\n    }\n    Ok(())\n}\n\nfn validate_fleet_identity(field: &str, value: &str) -> Result<()> {\n    if value.is_empty() {\n        bail!(\"fleet {field} cannot be empty\");\n    }\n    if value.len() > MAX_FLEET_ID_BYTES || !value.chars().all(is_worker_token_char) {\n        bail!(\n            \"fleet {field} must be a simple ASCII token no longer than {MAX_FLEET_ID_BYTES} bytes\"\n        );\n    }\n    Ok(())\n}\n\nfn validate_fleet_name(field: &str, value: &str) -> Result<()> {\n    if value.trim().is_empty() {\n        bail!(\"fleet {field} cannot be empty\");\n    }\n    if value.len() > MAX_FLEET_NAME_BYTES || value.chars().any(char::is_control) {\n        bail!(\n            \"fleet {field} must be one printable line no longer than {MAX_FLEET_NAME_BYTES} bytes\"\n        );\n    }\n    Ok(())\n}\n","sourceCodeStart":194,"sourceCodeEnd":230,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/fleet/task_spec.rs#L194-L230","documentation":"Fleet identity fields must be a plain ASCII token of at most MAX_FLEET_ID_BYTES bytes. validate_fleet_identity rejects values that are too long or contain characters outside the worker-token charset. This keeps fleet ids safe to embed in paths, protocol messages, and identifiers without escaping.","triggerScenarios":"validate_task_spec_document reaches validate_fleet_identity with a value whose byte length exceeds MAX_FLEET_ID_BYTES or which contains any character not accepted by is_worker_token_char (spaces, slashes, ':' etc.).","commonSituations":"Pasting a provider/model id like 'openai/gpt-4o' or a path into the fleet id field; very long descriptive ids; Unicode or whitespace in the id.","solutions":["Shorten the value to at most MAX_FLEET_ID_BYTES bytes","Replace disallowed characters so only is_worker_token_char-accepted ASCII chars remain","Move descriptive text to the fleet name field instead and keep the id a simple token"],"exampleFix":"// before\nlet id = \"team/production fleet #1\";\n// after\nlet id = \"team-prod-1\";","handlingStrategy":"validation","validationCode":"fn valid_fleet_id(v: &str) -> bool { !v.is_empty() && v.len() <= MAX_FLEET_ID_BYTES && v.chars().all(is_worker_token_char) }","typeGuard":"fn as_fleet_id(v: &str) -> Option<&str> { valid_fleet_id(v).then_some(v) }","tryCatchPattern":"if let Err(e) = validate_task_spec_document(&doc) { if e.to_string().contains(\"simple ASCII token\") { sanitize_and_retry(&mut doc); } }","preventionTips":["Keep ids to [A-Za-z0-9_-] style tokens","Never paste model ids or paths into id fields","Put human-readable text in the name field, not the id"],"tags":["validation","format","fleet"],"backgroundTag":"invalid-identifier-format","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}